1. 21 2月, 2012 1 次提交
    • T
      OMAPDSS: cleanup probe functions · cd3b3449
      Tomi Valkeinen 提交于
      Now that dss is using devm_ functions for allocation in probe functions,
      small reordering of the allocations allows us to clean up the probe
      functions more.
      
      This patch moves "unmanaged" allocations after the managed ones, and
      uses plain returns instead of gotos where possible. This lets us remove
      a bunch of goto labels, simplifying the probe's error handling.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      cd3b3449
  2. 10 2月, 2012 1 次提交
    • R
      ARM: omap: fix oops in drivers/video/omap2/dss/dpi.c · 40410715
      Russell King 提交于
      When a PMIC is not found, this driver is unable to obtain its
      'vdds_dsi_reg' regulator.  Even through its initialization function
      fails, other code still calls its enable function, which fails to
      check whether it has this regulator before asking for it to be enabled.
      
      This fixes the oops, however a better fix would be to sort out the
      upper layers to prevent them calling into a module which failed to
      initialize.
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000038
      pgd = c0004000
      [00000038] *pgd=00000000
      Internal error: Oops: 5 [#1] PREEMPT
      Modules linked in:
      CPU: 0    Not tainted  (3.3.0-rc2+ #228)
      PC is at regulator_enable+0x10/0x70
      LR is at omapdss_dpi_display_enable+0x54/0x15c
      pc : [<c01b9a08>]    lr : [<c01af994>]    psr: 60000013
      sp : c181fd90  ip : c181fdb0  fp : c181fdac
      r10: c042eff0  r9 : 00000060  r8 : c044a164
      r7 : c042c0e4  r6 : c042bd60  r5 : 00000000  r4 : c042bd60
      r3 : c084de48  r2 : c181e000  r1 : c042bd60  r0 : 00000000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 80004019  DAC: 00000015
      Process swapper (pid: 1, stack limit = 0xc181e2e8)
      Stack: (0xc181fd90 to 0xc1820000)
      fd80:                                     c001754c c042bd60 00000000 c042bd60
      fda0: c181fdcc c181fdb0 c01af994 c01b9a04 c0016104 c042bd60 c042bd60 c044a338
      fdc0: c181fdec c181fdd0 c01b5ed0 c01af94c c042bd60 c042bd60 c1aa8000 c1aa8a0c
      fde0: c181fe04 c181fdf0 c01b5f54 c01b5ea8 c02fc18c c042bd60 c181fe3c c181fe08
      fe00: c01b2a18 c01b5f48 c01aed14 c02fc160 c01df8ec 00000002 c042bd60 00000003
      fe20: c042bd60 c1aa8000 c1aa8a0c c042eff8 c181fe84 c181fe40 c01b3874 c01b29fc
      fe40: c042eff8 00000000 c042f000 c0449db8 c044ed78 00000000 c181fe74 c042eff8
      fe60: c042eff8 c0449db8 c0449db8 c044ed78 00000000 00000000 c181fe94 c181fe88
      fe80: c01e452c c01b35e8 c181feb4 c181fe98 c01e2fdc c01e4518 c042eff8 c0449db8
      fea0: c0449db8 c181fef0 c181fecc c181feb8 c01e3104 c01e2f48 c042eff8 c042f02c
      fec0: c181feec c181fed0 c01e3190 c01e30c0 c01e311c 00000000 c01e311c c0449db8
      fee0: c181ff14 c181fef0 c01e1998 c01e3128 c18330a8 c1892290 c04165e8 c0449db8
      ff00: c0449db8 c1ab60c0 c181ff24 c181ff18 c01e2e28 c01e194c c181ff54 c181ff28
      ff20: c01e2218 c01e2e14 c039afed c181ff38 c04165e8 c041660c c0449db8 00000013
      ff40: 00000000 c03ffdb8 c181ff7c c181ff58 c01e384c c01e217c c181ff7c c04165e8
      ff60: c041660c c003a37c 00000013 00000000 c181ff8c c181ff80 c01e488c c01e3790
      ff80: c181ff9c c181ff90 c03ffdcc c01e484c c181ffdc c181ffa0 c0008798 c03ffdc4
      ffa0: c181ffc4 c181ffb0 c0056440 c0187810 c003a37c c04165e8 c041660c c003a37c
      ffc0: 00000013 00000000 00000000 00000000 c181fff4 c181ffe0 c03ea284 c0008708
      ffe0: 00000000 c03ea208 00000000 c181fff8 c003a37c c03ea214 1073cec0 01f7ee08
      Backtrace:
      [<c01b99f8>] (regulator_enable+0x0/0x70) from [<c01af994>] (omapdss_dpi_display_enable+0x54/0x15c)
       r6:c042bd60 r5:00000000 r4:c042bd60
      [<c01af940>] (omapdss_dpi_display_enable+0x0/0x15c) from [<c01b5ed0>] (generic_dpi_panel_power_on+0x34/0x78)
       r6:c044a338 r5:c042bd60 r4:c042bd60
      [<c01b5e9c>] (generic_dpi_panel_power_on+0x0/0x78) from [<c01b5f54>] (generic_dpi_panel_enable+0x18/0x28)
       r7:c1aa8a0c r6:c1aa8000 r5:c042bd60 r4:c042bd60
      [<c01b5f3c>] (generic_dpi_panel_enable+0x0/0x28) from [<c01b2a18>] (omapfb_init_display+0x28/0x150)
       r4:c042bd60
      [<c01b29f0>] (omapfb_init_display+0x0/0x150) from [<c01b3874>] (omapfb_probe+0x298/0x318)
       r8:c042eff8 r7:c1aa8a0c r6:c1aa8000 r5:c042bd60 r4:00000003
      [<c01b35dc>] (omapfb_probe+0x0/0x318) from [<c01e452c>] (platform_drv_probe+0x20/0x24)
      [<c01e450c>] (platform_drv_probe+0x0/0x24) from [<c01e2fdc>] (really_probe+0xa0/0x178)
      [<c01e2f3c>] (really_probe+0x0/0x178) from [<c01e3104>] (driver_probe_device+0x50/0x68)
       r7:c181fef0 r6:c0449db8 r5:c0449db8 r4:c042eff8
      [<c01e30b4>] (driver_probe_device+0x0/0x68) from [<c01e3190>] (__driver_attach+0x74/0x98)
       r5:c042f02c r4:c042eff8
      [<c01e311c>] (__driver_attach+0x0/0x98) from [<c01e1998>] (bus_for_each_dev+0x58/0x98)
       r6:c0449db8 r5:c01e311c r4:00000000
      [<c01e1940>] (bus_for_each_dev+0x0/0x98) from [<c01e2e28>] (driver_attach+0x20/0x28)
       r7:c1ab60c0 r6:c0449db8 r5:c0449db8 r4:c04165e8
      [<c01e2e08>] (driver_attach+0x0/0x28) from [<c01e2218>] (bus_add_driver+0xa8/0x22c)
      [<c01e2170>] (bus_add_driver+0x0/0x22c) from [<c01e384c>] (driver_register+0xc8/0x154)
      [<c01e3784>] (driver_register+0x0/0x154) from [<c01e488c>] (platform_driver_register+0x4c/0x60)
       r8:00000000 r7:00000013 r6:c003a37c r5:c041660c r4:c04165e8
      [<c01e4840>] (platform_driver_register+0x0/0x60) from [<c03ffdcc>] (omapfb_init+0x14/0x34)
      [<c03ffdb8>] (omapfb_init+0x0/0x34) from [<c0008798>] (do_one_initcall+0x9c/0x164)
      [<c00086fc>] (do_one_initcall+0x0/0x164) from [<c03ea284>] (kernel_init+0x7c/0x120)
      [<c03ea208>] (kernel_init+0x0/0x120) from [<c003a37c>] (do_exit+0x0/0x2d8)
       r5:c03ea208 r4:00000000
      Code: e1a0c00d e92dd870 e24cb004 e24dd004 (e5906038)
      ---[ end trace 9e2474c2e193b223 ]---
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      40410715
  3. 26 1月, 2012 2 次提交
    • T
      OMAPDSS: HDMI: PHY burnout fix · c49d005b
      Tomi Valkeinen 提交于
      A hardware bug in the OMAP4 HDMI PHY causes physical damage to the board
      if the HDMI PHY is kept powered on when the cable is not connected.
      
      This patch solves the problem by adding hot-plug-detection into the HDMI
      IP driver. This is not a real HPD support in the sense that nobody else
      than the IP driver gets to know about the HPD events, but is only meant
      to fix the HW bug.
      
      The strategy is simple: If the display device is turned off by the user,
      the PHY power is set to OFF. When the display device is turned on by the
      user, the PHY power is set either to LDOON or TXON, depending on whether
      the HDMI cable is connected.
      
      The reason to avoid PHY OFF when the display device is on, but the cable
      is disconnected, is that when the PHY is turned OFF, the HDMI IP is not
      "ticking" and thus the DISPC does not receive pixel clock from the HDMI
      IP. This would, for example, prevent any VSYNCs from happening, and
      would thus affect the users of omapdss. By using LDOON when the cable is
      disconnected we'll avoid the HW bug, but keep the HDMI working as usual
      from the user's point of view.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      c49d005b
    • T
      OMAPDSS: use sync versions of pm_runtime_put · 0eaf9f52
      Tomi Valkeinen 提交于
      omapdss doesn't work properly on system suspend. The problem seems to be
      the fact that omapdss uses pm_runtime_put() functions when turning off
      the hardware, and when system suspend is in process only sync versions
      are allowed.
      
      Using non-sync versions normally and sync versions when suspending would
      need rather ugly hacks to convey the information of
      suspending/not-suspending to different functions. Optimally the driver
      wouldn't even need to care about this, and the PM layer would handle
      syncing when suspend is in process.
      
      This patch changes all omapdss's pm_runtime_put calls to
      pm_runtime_put_sync. This fixes the suspend problem, and probably the
      performance penalty of always using sync versions is negligible.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NKevin Hilman <khilman@ti.com>
      0eaf9f52
  4. 25 1月, 2012 13 次提交
  5. 13 1月, 2012 1 次提交
  6. 05 1月, 2012 4 次提交
  7. 02 1月, 2012 8 次提交
    • C
      OMAPDSS: DISPC: Update Scaling Clock Logic · 7282f1b7
      Chandrabhanu Mahapatra 提交于
      Clock requirements for scaling in OMAP2, OMAP3 and OMAP4 are different. In
      OMAP2 and OMAP3 the required clock rate is a function of pixel clock, vertical
      downscale ratio and horizontal downscale ratio whereas in OMAP4 it is a
      function of pixel clock and horizontal downscale ratio only. Selection of 3-tap
      vs 5-tap coefficients depends on clock rate line buffer width in OMAP3 whereas
      in OMAP4 it is independent of clock rate and line buffer width. In OMAP2 3-tap
      for vertical and 5-tap for horizontal scaling is used. In OMAP4 5-tap is used
      both for horizontal and vertical scaling for better performance. Also, the
      number and width of line buffers differs in OMAP3 and OMAP4.
      
      So, clock functions have been fined tuned for OMAP3 and support has been added
      added for OMAP4. This code has been tested on OMAP2, OMAP3 and OMAP4, and
      scaling issues due to clock errors have been resolved.
      Signed-off-by: NChandrabhanu Mahapatra <cmahapatra@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      7282f1b7
    • C
      OMAPDSS: DISPC: Update Fir Coefficients · debd9074
      Chandrabhanu Mahapatra 提交于
      The FIR coefficients present in kernel are being updated to new coefficients
      consisting of 24 coefficient tables, with 12 each for 3 tap and 5 tap scenario,
      which are chosen on the basis of DISPC up/downsampling filters M value. M is
      the inverse of low pass cut off frequency of the sampling filter. For vertical
      scaling 3 tap or 5 tap tables are used based on the clock rate and width of
      the line buffer whereas in OMAP2 3 tap is always used. For horizontal scaling
      however 5 tap tables are always used.
      
      New coefficients and the corresponding logic have been tested on OMAP2, OMAP3
      and OMAP4. Horizontal and vertical scaling worked fine except for some 3 tap
      vs 5 tap issue during vertical upscaling and clock failing issues which is
      acknowledged in the next patch. Vertical upscaling was found to perform better
      under 5 taps. The 24 coefficient tables have been moved to another file
      dispc_coefs.c for proper maintainance.
      
      This code is written based on code written by Lajos Molnar <lajos@ti.com> in
      Android Kernel for scaling. Lajos Molnar <lajos@ti.com> had fine tuned the FIR
      coefficient selection process and reduced outliness and blockiness around
      images when upscaling more than 2 times.
      Signed-off-by: NChandrabhanu Mahapatra <cmahapatra@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      debd9074
    • R
      OMAPDSS: APPLY: fix NULL pointer deref when mgr is not set · 1f3f53ae
      Rob Clark 提交于
      extra_info_update_ongoing() goes through all overlays, but doesn't check
      if the overlay is connected to a manager. This leads to a crash whenever
      an overlay has been detached.
      
      Add a check to skip the non-connected overlays.
      Reported-by: NRob Clark <rob@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      1f3f53ae
    • A
      OMAPDSS: DSI: Fix HSDIV related PLL info in dsi_dump_clocks() · 84309f16
      Archit Taneja 提交于
      The clock names of DSI_PLL_HSDIV_DISPC and DSI_PLL_HSDIV_DSI was made
      dynamic based on the current value of DISPC and DSI FCLK sources. This
      doesn't need to be done since we are just interested in the clock names,
      and not the current clock sources for DISPC and DSI FCLKs.
      
      Use only the generic and omap specific names for the DSI PLL's HSDIV
      clocks.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      84309f16
    • T
      OMAPDSS: APPLY: move simple_check functions · 54540d41
      Tomi Valkeinen 提交于
      The functions dss_ovl_simple_check() and dss_mgr_simple_check() are not
      really part of the apply mechanism, and can be moved to overlay.c and
      manager.c.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      54540d41
    • R
      OMAPDSS: fix potential NULL pointer ref in OCP_ERR handling path · 00f17e45
      Rob Clark 提交于
      The dispc's error handler tries to disable all outputs when OCP_ERR
      happens. However, the code doesn't check if there actually is a display
      on each particular output, nor if there's a driver for the display. This
      may lead to NULL pointer reference.
      Signed-off-by: NRob Clark <rob@ti.com>
      [tomi.valkeinen@ti.com: added patch description]
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      00f17e45
    • T
      OMAPDSS: APPLY: move check functions · 6ac48d1e
      Tomi Valkeinen 提交于
      The functions dss_ovl_check, dss_mgr_check_zorder, dss_mgr_check in
      apply.c are not really part of the apply mechanism, and can be moved to
      overlay.c and manager.c.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      6ac48d1e
    • T
      OMAPDSS: APPLY: remove unused variables · 5af661ce
      Tomi Valkeinen 提交于
      dss_mgr_check_zorder() has two unused variables. Remove them.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5af661ce
  8. 02 12月, 2011 10 次提交
    • T
      OMAPDSS: APPLY: write fifo thresholds only if changed · 04576d41
      Tomi Valkeinen 提交于
      Current code will always write fifo threshold values to the register,
      even if they are the same as previously. Separate the setting of fifo
      fields into a separate function, and only set new values if they are
      different than the old ones.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      04576d41
    • T
      OMAPDSS: APPLY: add dss_setup_fifos · 75ae118a
      Tomi Valkeinen 提交于
      Currently fifo threshold configuration is done per overlay or per
      manager. However, when a fifo size configuration is added, we need to
      always configure the thresholds for all overlays.
      
      This patch prepares for that by changing the fifo threshold
      configuration to always handle all overlays.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      75ae118a
    • T
      OMAPDSS: APPLY: simplify dss_mgr_enable · a6b24f83
      Tomi Valkeinen 提交于
      dss_mgr_enable() has some extra assigns to mp->enabled, which can be
      removed.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      a6b24f83
    • T
      OMAPDSS: APPLY: add op->enabling · 82153eda
      Tomi Valkeinen 提交于
      When we are enabling an overlay, there's a point in time when the
      overlay is not actually enabled yet (nor do we want it to be enabled),
      but we do want to check if the configuration for the overlay is valid,
      and to calculate correct fifo thresholds for the soon-to-be-enabled
      overlay.
      
      Current code handled this in a hacky way, setting op->enabled to true
      temporarily when calling functions that need to consider the state when
      the overlay is enabled.
      
      This patch makes this a bit cleaner, adding "enabling" field, which is
      set when the overlay is not yet enabled but should be considered in the
      checks and calculations.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      82153eda
    • T
      OMAPDSS: APPLY: cleanup extra_info_update_ongoing · 153b6e73
      Tomi Valkeinen 提交于
      Trivial cleanup for extra_info_update_ongoing(), making the function a
      bit cleaner.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      153b6e73
    • T
      OMAPDSS: APPLY: add dss_set_go_bits() · 3ab15b2a
      Tomi Valkeinen 提交于
      Currently dss_write_regs() implicitely sets the GO bits for all managers
      with shadow dirty flags set. This is a bit misleading, as one does not
      presume "write registers" function to also set the GO bit.
      
      Thus this patch splits the setting of GO bits into a separate function,
      dss_set_go_bits, which is used after writing the registers.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3ab15b2a
    • T
      OMAPDSS: APPLY: clear shadow dirty flags only if GO had been set · 5b214171
      Tomi Valkeinen 提交于
      In the apply irq handler the code currently clears the shadow dirty
      flags whenever the manager in question is not busy (i.e. GO bit is
      down). However, this is not quite right, as the GO bit may have never
      been set.
      
      While not done in the current code, the above would cause bug in
      scenario where the registers are written, and thus shadow_dirty flag is
      set, but the GO bit will be set only later. In this case the
      shadow_dirty flags would be cleared, even if the HW is not using the new
      configurations.
      
      This patch fixes the issue by clearing the shadow flags only when the GO
      bit is clear, and the GO bit had been set.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5b214171
    • T
      OMAPDSS: APPLY: fix need_isr · 9f808956
      Tomi Valkeinen 提交于
      need_isr() should return true whenever there's work that needs to be
      handled in the VSYNC/FRAMEDONE irq handler. However, need_isr() is
      missing some cases where we need the irq handler.
      
      This patch adds checks for shadow dirty flags, so that the irq handler
      is started/kept running while shadow dirty flags are set.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      9f808956
    • T
      OMAPDSS: APPLY: fix extra_info_update_ongoing · cc372d84
      Tomi Valkeinen 提交于
      extra_info_update_ongoing() skipped checks for overlays that were marked
      as disabled. This doesn't work, as the enable status of an overlay is in
      the extra_info group, and thus extra_info_update_ongoing() reports false
      when we are disabling an overlay. This causes
      wait_pending_extra_info_updates() to not wait for the ongoing overlay
      disable.
      
      This patch changes extra_info_update_ongoing() to check the state of
      overlays marked as disabled.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      cc372d84
    • T
      OMAPDSS: check the return value of dss_mgr_enable() · 33ca237f
      Tomi Valkeinen 提交于
      Now that dss_mgr_enable returns an error value, check it in all the
      places dss_mgr_enable is used, and bail out properly.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      33ca237f