1. 13 6月, 2015 14 次提交
  2. 24 3月, 2015 5 次提交
    • T
      drm/omap: keep ref to old_fb · 223bfd69
      Tomi Valkeinen 提交于
      We store the fb being page-flipped to 'old_fb' field, but we don't
      increase the ref count of the fb when doing that. While I am not
      sure if it can cause problem in practice, it's still safer to keep a ref
      when storing a pointer to a fb.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      223bfd69
    • T
      drm/omap: only ignore DIGIT SYNC LOST for TV output · ef422283
      Tomi Valkeinen 提交于
      We need to ignore DIGIT SYNC LOST error when enabling/disabling TV
      output. The code does that, but it ignores the DIGI SYNC LOST when
      enabling any output. Normally this does no harm, but it could make us
      miss DIGIT SYNC LOST on some rare occasions.
      
      Fix the code to only ignore DIGIT SYNC LOST when enabling/disabling TV.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ef422283
    • T
      drm/omap: fix race with error_irq · a36af73f
      Tomi Valkeinen 提交于
      omapdrm tries to avoid error floods by unregistering the error irq when
      an error happens, and then registering the error irq again later.
      However, the code is racy, as it sometimes tries to unregister the error
      irq when it's already unregistered, leading to WARN().
      
      Also, the code only registers the error irq again when something is done
      on that particular output, i.e. if only TV is used to flip the buffers,
      and LCD is showing a same buffer, an error on LCD will cause the LCD
      error irq to be unregistered and never registered again.
      
      To fix this, let's keep the error irqs always enabled and trust the
      DRM_ERROR_RATELIMITED to limit the flood.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      a36af73f
    • T
      drm/omap: use DRM_ERROR_RATELIMITED() for error irqs · 3b143fc8
      Tomi Valkeinen 提交于
      omapdrm uses normal DRM_ERROR() print when the HW reports an error. As
      we sometimes may get a flood of errors, let's rather use
      DRM_ERROR_RATELIMITED().
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3b143fc8
    • T
      drm/omap: page_flip: return -EBUSY if flip pending · 549a7549
      Tomi Valkeinen 提交于
      The DRM documentation says:
      
      "If a page flip is already pending, the page_flip operation must return
      -EBUSY."
      
      Currently omapdrm returns -EINVAL instead. Fix omapdrm by returning
      -EBUSY.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      549a7549
  3. 20 3月, 2015 8 次提交
  4. 05 11月, 2014 1 次提交
  5. 05 6月, 2014 1 次提交
    • R
      drm: convert crtc and connection_mutex to ww_mutex (v5) · 51fd371b
      Rob Clark 提交于
      For atomic, it will be quite necessary to not need to care so much
      about locking order.  And 'state' gives us a convenient place to stash a
      ww_ctx for any sort of update that needs to grab multiple crtc locks.
      
      Because we will want to eventually make locking even more fine grained
      (giving locks to planes, connectors, etc), split out drm_modeset_lock
      and drm_modeset_acquire_ctx to track acquired locks.
      
      Atomic will use this to keep track of which locks have been acquired
      in a transaction.
      
      v1: original
      v2: remove a few things not needed until atomic, for now
      v3: update for v3 of connection_mutex patch..
      v4: squash in docbook
      v5: doc tweaks/fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      51fd371b
  6. 15 4月, 2014 4 次提交
  7. 14 4月, 2014 4 次提交
    • T
      drm/omap: fix enabling/disabling of video pipeline · 506096a1
      Tomi Valkeinen 提交于
      At the moment the omap_crtc_pre_apply() handles the enabling, disabling
      and configuring of encoders and panels separately from the CRTC (i.e.
      the overlay manager).
      
      However, this doesn't work correctly. The encoder driver has to be in
      control of its video input (i.e. the crtc) for correct operation.
      
      This problem causes bugs with (at least) HDMI: the HDMI encoder supplies
      pixel clock for DISPC, and DISPC supplies video stream for HDMI. The
      current code first enables the HDMI encoder, and CRTC after that.
      However, the encoder expects the video stream to start during the
      encoder's enable, and if it doesn't, there will be sync lost errors.
      
      The encoder enables its video source by calling src->enable(), and this
      call goes to omapdrm (omap_crtc_enable), but omapdrm doesn't do anything
      in that function. Similarly for disable, which goes to
      omap_crtc_disable().
      
      This patch moves the code to setup and enable/disable the crtc to
      omap_crtc_enable. and omap_crtc_disable().
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      506096a1
    • T
      drm/omap: fix missing disable for unused encoder · c7aef12f
      Tomi Valkeinen 提交于
      When an encoder is no longer connected to a crtc, the driver will leave
      the encoder enabled.
      
      This patch adds code to track the encoder used for a crtc, and when the
      encoder changes, the old one is disabled.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      c7aef12f
    • T
      drm/omap: fix race issue when unloading omapdrm · e2f8fd74
      Tomi Valkeinen 提交于
      At module unload, omap_fbdev_free() gets called which releases the
      framebuffers. However, the framebuffers are still used by crtcs, and
      will be released only later at vsync. The driver doesn't wait for this,
      and goes on to release the rest of the resources, which often
      causes a crash.
      
      This patchs adds a omap_crtc_flush() function which waits until the crtc
      has finished with its apply queue and page flips.
      
      The function utilizes a simple polling while-loop, as the performance is
      not an issue here.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      e2f8fd74
    • T
      drm/omap: fix output enable/disable sequence · 2ec8e378
      Tomi Valkeinen 提交于
      At the moment it's quite easy to get the following errors when the HDMI
      output is enabled or disabled:
      
      [drm:omap_crtc_error_irq] *ERROR* tv: errors: 00008000
      
      The reason for the errors is that the omapdrm driver doesn't properly
      handle the sync-lost irqs that happen when enabling the DIGIT crtc,
      which is used for HDMI and analog TV. The driver does disable the
      sync-lost irq properly, but it fails to wait until the output has been
      fully enabled (i.e. the first vsync), so the sync-lost errors are still
      seen occasionally.
      
      This patch makes the omapdrm act the same way as the omapfb does:
      
      - When enabling a display, we'll wait for the first vsync.
      - When disabling a display, we'll wait for framedone if available, or
        odd and even vsyncs.
      
      These changes make sure the output is fully enabled or disabled at the
      end of the function.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reported-by: NSanjay Singh Rawat <sanjay.rawat@linaro.org>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      2ec8e378
  8. 02 4月, 2014 1 次提交
    • M
      drm: Replace crtc fb with primary plane fb (v3) · f4510a27
      Matt Roper 提交于
      Now that CRTC's have a primary plane, there's no need to track the
      framebuffer in the CRTC.  Replace all references to the CRTC fb with the
      primary plane's fb.
      
      This patch was generated by the Coccinelle semantic patching tool using
      the following rules:
      
              @@ struct drm_crtc C; @@
              -   (C).fb
              +   C.primary->fb
      
              @@ struct drm_crtc *C; @@
              -   (C)->fb
              +   C->primary->fb
      
      v3: Generate patch via coccinelle.  Actual removal of crtc->fb has been
          moved to a subsequent patch.
      
      v2: Fixup several lingering crtc->fb instances that were missed in the
          first patch iteration.  [Rob Clark]
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      f4510a27
  9. 09 1月, 2014 2 次提交
    • A
      drm/omap: fix: Defer probe if an omapdss device requests for it at connect · 3a01ab25
      Archit Taneja 提交于
      With the omapdss device model changes. omapdrm is required to call dssdriver's
      connect() op to register a panel. This is currently done in omap_modeset_init()
      
      A call to connect() can fail if the omapdss panels or the encoders(HDMI/DPI)
      they connect to have some resource(like regulators, I2C adapter) missing. If
      this happens, the correct approach is to defer omapdrm's probe.
      
      omapdrm currently ignores those panels which return a non zero value when
      connected. This could result in omapdrm ignoring all panels on an omap board.
      
      The right approach would be for omapdrm to request for probe deferral when a
      panel's connect op returns -EPROBE_DEFER.
      
      In order to do this, we need to call connect() much earlier during omapdrm's
      probe to prevent too many things are already done by then. We now connect the
      panels during pdev_probe(), before anything else is initialized, so that we
      don't need to undo too many things if a defer was requested.
      
      Now when we enter omap_modeset_init(), we have a set of panels that have been
      connected. We now proceed with registering only those panels that are already
      connected.
      
      A special case has to be considered when no panels are available to connect when
      omapdrm probes. In this case too, we defer probe and expect that a panel will be
      available to connect the next time.
      
      Checking whether the panel has a driver or whether it has get_timing/read_edid
      ops in omap_modeset_init() are redundant with the new display model. These can
      be removed since a dssdev device will always have a driver associated with it,
      and all dssdev drivers have a get_timings op.
      
      This will mainly fix cases when omapdrm is built-in the kernel, since that's
      generally where resources like regulators or I2C are unavailable because of
      probe order dependencies.
      
      In particular this fixes boot with omapdrm built-in on an omap4 panda ES board.
      The regulators used by HDMI(provided by I2C based TWL regulators) aren't
      initialized because I2C isn't initialized, I2C isn't initialized as it's pins
      are not configured because pinctrl is yet to probe.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3a01ab25
    • T
      drm/omap: fix (un)registering irqs inside an irq handler · 6da9f891
      Tomi Valkeinen 提交于
      omapdrm (un)registers irqs inside an irq handler. The problem is that
      the (un)register function uses dispc_runtime_get/put() to enable the
      clocks, and those functions are not irq safe by default.
      
      This was kind of fixed in 48664b21
      (OMAPDSS: DISPC: set irq_safe for runtime PM), which makes dispc's
      runtime calls irq-safe.
      
      However, using pm_runtime_irq_safe in dispc makes the parent of dispc,
      dss, always enabled, effectively preventing PM for the whole DSS module.
      
      This patch makes omapdrm behave better by adding new irq (un)register
      functions that do not use dispc_runtime_get/put, and using those
      functions in interrupt context. Thus we can make dispc again
      non-irq-safe, allowing proper PM.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Rob Clark <robdclark@gmail.com>
      6da9f891