1. 13 3月, 2012 1 次提交
  2. 06 3月, 2012 2 次提交
    • T
      OMAPDSS: APPLY: print warning if wait_pending_extra_info_updates fails · 4614679c
      Tomi Valkeinen 提交于
      wait_pending_extra_info_updates() currently does a hacky second check
      for extra_info_update_ongoing() at the end of the function to show a
      warning if extra_info update is still ongoing. The call to
      extra_info_update_ongoing() should really be inside spinlock, but that's
      a bit heavy just for verification.
      
      Rather than that, check the return value of the
      wait_for_completion_timeout() and print an error if it has timeouted or
      returned an error.
      
      Even better would be to return the error value and act on it in the
      callers of wait_pending_extra_info_updates. However, it's not clear what
      the callers should do in case of an error, as the error should only
      happen if there's a bug in the driver or the HW. So we'll just print the
      warning for now.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      4614679c
    • L
      OMAPDSS: MANAGER/APPLY: Add runtime_pm protection around wait_for_go/vsync functions · 21e56f79
      Lajos Molnar 提交于
      If DSS suspends within the functions dss_mgr_wait_for_go(),
      dss_mgr_wait_for_go_ovl() or dss_mgr_wait_for_vsync(). It may lose it's clock
      and lead to a register access failure.
      
      Request runtime_pm around these functions.
      
      [archit@ti.com: Moved runtime_pm calls to wait_for_go/vsync functions rather
      then calling them from omap_dispc_wait_for_irq_interruptible_timeout()]
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      21e56f79
  3. 01 3月, 2012 1 次提交
    • T
      OMAPDSS: APPLY: make ovl_enable/disable synchronous · a3d0e4ae
      Tomi Valkeinen 提交于
      ovl->enable/disable are meant to be synchronous so that they can handle
      the configuration of fifo sizes. The current kernel doesn't configure
      fifo sizes yet, and so the code doesn't need to block to function (from
      omapdss driver's perspective).
      
      However, for the users of omapdss a non-blocking ovl->disable is
      confusing, because they don't know when the memory area is not used
      any more.
      
      Furthermore, when the fifo size configuration is added in the next merge
      window, the change from non-blocking to blocking could cause side
      effects to the users of omapdss. So by making the functions block
      already will keep them behaving in the same manner.
      
      And, while not the main purpose of this patch, this will also remove the
      compile warning:
      
      drivers/video/omap2/dss/apply.c:350: warning:
      'wait_pending_extra_info_updates' defined but not used
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      a3d0e4ae
  4. 25 1月, 2012 3 次提交
    • T
      OMAPDSS: DISPC: move fifo threhold calc to dispc.c · 83fa2f2e
      Tomi Valkeinen 提交于
      Move fifo threshold calculation into dispc.c, as the thresholds are
      really dispc internal thing.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      83fa2f2e
    • T
      OMAPDSS: APPLY: add fifo-merge support · 1d71f42b
      Tomi Valkeinen 提交于
      Add fifo-merge support. This is done mainly in four functions:
      mgr_enable/disable and ovl_enable/disable. These are the functions where
      overlays are taken into and out of active use.
      
      The process to enable and disable fifo-merge is not simple. We need to
      do it in steps, waiting in between for certain settings to be taken into
      use, and continuing after that. The reason for this is that fifo-merge
      is a common thing for all managers/overlays, and its use must be
      synchronized.
      
      As an example, when we disable an overlay, we first set the overlay as
      disabled, then wait until the overlay is actually disabled in the HW,
      and only after that we may re-configure the fifos, possibly taking
      fifo-merge into use.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      1d71f42b
    • T
      OMAPDSS: APPLY: add fifo merge support funcs · fb011974
      Tomi Valkeinen 提交于
      Add mechanism to set/unset the DISPC fifo-merge:
      
      Add new fields to dss_data, fifo_merge and fifo_merge_dirty. These are
      similar to the other info/dirty flags in ovl_priv_data and ovl_mgr_data,
      but fifo merge is a common attribute to all managers and thus outside
      the ovl_mgr_data.
      
      The fifo-merge field is used in the dss_write_regs_common, which handles
      writing the register.
      
      dss_apply_fifo_merge() can be used to set/unset the fifo merge field in
      the dss_data.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      fb011974
  5. 02 1月, 2012 4 次提交
  6. 02 12月, 2011 29 次提交
    • 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: APPLY: add return value to dss_mgr_enable() · 2a4ee7ee
      Tomi Valkeinen 提交于
      Now that dss_mgr_enable() can fail due to checks, make it return the
      error value.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      2a4ee7ee
    • T
      OMAPDSS: APPLY: add checking of ovls/mgrs settings · 39518356
      Tomi Valkeinen 提交于
      Add checks for overlay and manager settings. The checks are a bit
      complex, as we need to observe the bigger picture instead of overlays
      and managers independently. Things like the used display and the zorder
      of other overlays affect the validity of the settings.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      39518356
    • T
      OMAPDSS: APPLY: add dss_mgr_simple_check() · f17d04fb
      Tomi Valkeinen 提交于
      Add dss_mgr_simple_check() which is used to check the validity of
      certain manager attributes. Only attributes that can be checked
      independently, without knowing the display being used, is done here
      (thus "simple").
      
      We can use this function in dss_mgr_set_info().
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f17d04fb
    • T
      OMAPDSS: APPLY: add dss_ovl_simple_check() · fcc764dc
      Tomi Valkeinen 提交于
      Add dss_ovl_simple_check() which is used to check the validity of
      certain overlay attributes. Only attributes that can be checked
      independently, without knowing the display being used, is done here
      (thus "simple").
      
      We can use this function in dss_ovl_set_info().
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      fcc764dc
    • T
      OMAPDSS: APPLY: remove runtime_get · e70f98ac
      Tomi Valkeinen 提交于
      apply.c no longer touches any registers if an output is not enabled.
      This means that we don't need to do dispc_runtime_get() anymore, and the
      calls can be removed.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      e70f98ac
    • T
      OMAPDSS: APPLY: add wait_pending_extra_info_updates() · f1577ce1
      Tomi Valkeinen 提交于
      Add wait_pending_extra_info_updates() function which can be used to wait
      until any extra_info changes have been taken into use by the hardware.
      This can be only called when holding the apply mutex, so that other
      threads cannot insert new extra_info changes.
      
      This will be used to handle fifo-configurations.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f1577ce1
    • T
      OMAPDSS: APPLY: skip enable/disable if already enabled/disabled · e4f7ad70
      Tomi Valkeinen 提交于
      Add checks to dss_mgr_enable, dss_mgr_disable, dss_ovl_enable,
      dss_ovl_disable that check if the state is already the same as given in
      the parameters, and exit if so.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      e4f7ad70
    • T
      OMAPDSS: APPLY: add dss_apply_ovl_enable() · 841c09c7
      Tomi Valkeinen 提交于
      Add a helper function dss_apply_ovl_enable(), which is similar to the
      main apply() function: dss_apply_ovl_enable() applies the given overlay
      enable-status to ovl_priv_data, and sets the dirty flag.
      
      The difference between the helper function and the previous direct use
      of the fields is that the helper function will not do anything if the
      enable state is already the same as given in the parameter.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      841c09c7
    • T
      OMAPDSS: APPLY: remove device_changed field · ff4733dc
      Tomi Valkeinen 提交于
      omap_overlay_manager contains device_changed field, which no longer has
      any use. So remove the field and the few places where it is touched.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ff4733dc
    • T
      OMAPDSS: APPLY: rename dirty & shadow_dirty · 0b53f179
      Tomi Valkeinen 提交于
      Rename ovl_priv_data's and mgr_priv_data's dirty and shadow_dirty fields
      to info_dirty and shadow_info_dirty to better reflect what they mean.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      0b53f179
    • T
      OMAPDSS: APPLY: move fifo thresholds to extra_info set · 6dc802e2
      Tomi Valkeinen 提交于
      Setting overlay's fifo thresholds is currently handled at the same time
      as other overlay attributes. This is not right, as the normal attributes
      should only affect one overlay and manager, but changing the fifo
      thresholds are needed in cases like fifo-merge, where multiple managers
      are affected.
      
      This patch moves the channel field into the "extra_info" set, handled
      together with channel and enabled-status.
      
      This also lets us to calculate the fifos only when needed, specifically,
      when an overlay or a manager is enabled.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      6dc802e2
    • T
      OMAPDSS: APPLY: move channel-field to extra_info set · 5d5a97a6
      Tomi Valkeinen 提交于
      Setting overlay's output channel is currently handled at the same time
      as other overlay attributes. This is not right, as the normal attributes
      should only affect one overlay and manager, but changing the channel
      affects two managers.
      
      This patch moves the channel field into the "extra_info" set, handled
      together with enabled-status.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5d5a97a6
    • T
      OMAPDSS: APPLY: move ovl->info to apply.c · c1a9febf
      Tomi Valkeinen 提交于
      struct omap_overlayr contains info and info_dirty fields, both of which
      should be internal to apply.c.
      
      This patch moves those fields into ovl_priv data, and names them
      user_info and user_info_dirty.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      c1a9febf
    • T
      OMAPDSS: APPLY: move mgr->info to apply.c · 388c4c6c
      Tomi Valkeinen 提交于
      struct omap_overlay_manager contains info and info_dirty fields, both of
      which should be internal to apply.c.
      
      This patch moves those fields into mgr_priv data, and names them
      user_info and user_info_dirty.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      388c4c6c
    • T
      OMAPDSS: APPLY: clean up isr_handler · 7609893c
      Tomi Valkeinen 提交于
      Add a helper function mgr_clear_shadow_dirty(), which clears the
      shadow_dirty flags for the given manager and for the overlays on that
      manager.
      
      This lets us simplify the code in the dss_apply_irq_handler().
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      7609893c
    • T
      OMAPDSS: APPLY: add updating flag · 34861378
      Tomi Valkeinen 提交于
      Add "updating" flag to mgr_priv_data, which is used to track whether the
      manager is currently actively working, i.e. updating the screen.
      
      For auto-update displays updating is always true when the display is
      enabled, but for manual update displays the flag is true only during
      frame transfers.
      
      The flag is used to manage registers properly, for example when updating
      is false and a register for a manager is written, there's no need to set
      shadow_dirty flag nor set the GO bit, as the settings will be taken into
      use by the HW automatically when the output is enabled.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      34861378
    • T
      OMAPDSS: APPLY: rewrite register writing · 75c94965
      Tomi Valkeinen 提交于
      The functions writing to the DISPC registers in apply.c are more complex
      than needed. This patch cleans things up.
      
      Two helper functions are added: need_isr(), which returns if an isr for
      VSYNC is needed, and need_go(), which tells if there has been a write to
      the shadow registers and we need to set the GO bit.
      
      The functions that call the actual dispc write functions will set the
      dirty and shadow_dirty flags themselves, instead of that being done on
      the caller side. The writing functions also check if the dirty flag is
      even set, and return immediately if not.
      
      This allows us to clean up dss_write_regs().
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      75c94965
    • T
      OMAPDSS: APPLY: rewrite overlay enable/disable · aaa874a9
      Tomi Valkeinen 提交于
      Overlays are currently enabled and disabled with a boolean in the struct
      omap_overlay_info. The overlay info is set with ovl->set_overlay_info(),
      and made into use with mgr->apply().
      
      This doesn't work properly, as the enable/disable status may affect also
      other overlays, for example when using fifo-merge. Thus the enabling and
      disabling of the overlay needs to be done outside the normal overlay
      configuration.
      
      This patch achieves that by doing the following things:
      
      1) Add function pointers to struct omap_overlay: enable(), disable() and
      is_enabled(). These are used to do the obvious. The functions may block.
      
      2) Move the "enabled" field from struct omap_overlay to ovl_priv_data.
      
      3) Add a new route for settings to be applied to the HW, called
      "extra_info". The status of the normal info and extra_info are tracked
      separately.
      
      The point here is to allow the normal info to be changed and
      applied in non-blocking matter, whereas the extra_info can only be
      changed when holding the mutex. This makes it possible to, for example,
      set the overlay enable flag, apply it, and wait until the HW has taken
      the flag into use.
      
      This is not possible if the enable flag would be in the normal info, as
      a new value for the flag could be set at any time from the users of
      omapdss.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      aaa874a9
    • T
      OMAPDSS: APPLY: add busy field to mgr_priv_data · 43a972d9
      Tomi Valkeinen 提交于
      Add a new field to mgr_priv data, "busy", which is used to track the
      status of GO bit with the manager. As manual update displays never use
      the GO bit, the field is always false for managers used for manual
      update displays.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      43a972d9
    • T
      OMAPDSS: APPLY: move mgr->enabled to mgr_priv_data · bf213523
      Tomi Valkeinen 提交于
      struct omap_overlay_manager contains "enabled"-field, used to track if
      the manager is enabled or not. This field should be internal to apply.c.
      
      This patch moves the field to mgr_priv_data, and applies the necessary
      locking when accessing the field.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      bf213523