1. 13 6月, 2015 10 次提交
  2. 24 3月, 2015 6 次提交
    • G
      drm/omap: add hibernation callbacks · 8450c8d0
      Grygorii Strashko 提交于
      Setting a dev_pm_ops suspend/resume pair but not a set of hibernation
      functions means those pm functions will not be called upon hibernation.
      
      Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the
      suspend and hibernation handlers and move
      omap_drm_suspend/omap_drm_resume under CONFIG_PM_SLEEP to avoid build
      warnings.
      Signed-off-by: NGrygorii Strashko <Grygorii.Strashko@linaro.org>
      [tomi.valkeinen@ti.com: fix conflict, clean up description]
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      8450c8d0
    • T
      drm/omap: fix race condition with dev->obj_list · 76c4055f
      Tomi Valkeinen 提交于
      omap_gem_objects are added to dev->obj_list in omap_gem_new, and removed
      in omap_gem_free_object. Unfortunately there's no locking for
      dev->obj_list, which eventually leads to a crash:
      
      WARNING: CPU: 1 PID: 1123 at lib/list_debug.c:59 __list_del_entry+0xa4/0xe0()
      list_del corruption. prev->next should be e9281344, but was ea722b84
      
      Add a spinlock to protect dev->obj_list.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      76c4055f
    • T
      drm/omap: stop connector polling during suspend · ccd7b5ed
      Tomi Valkeinen 提交于
      When not using proper hotplug detection, DRM polls periodically the
      connectors to find out if a cable is connected. This polling can happen
      at any time, even very late in the suspend process.
      
      This causes a problem with omapdrm, when the poll happens during the
      suspend process after GPIOs have been disabled, leading to a crash in
      gpio_get().
      
      This patch fixes the issue by adding suspend and resume hooks to
      omapdrm, in which we disable and enable, respectively, the polling.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      ccd7b5ed
    • T
      drm/omap: remove dummy PM functions · f5a1d317
      Tomi Valkeinen 提交于
      omapdrm has dummy functions for platform_device's
      suspend/resume/shutdown. The functions don't do anything, and those
      platform device functions are deprecated, so remove them from omapdrm.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      f5a1d317
    • T
      drm/omap: fix operation without fbdev · c7c1aecd
      Tomi Valkeinen 提交于
      omapdrm should work fine even if fbdev is missing. The current driver
      crashes in that case, though, as it is missing checks for the fbdev.
      
      Add the checks so that we don't free fbdev or restore fbdev mode when
      there's no fbdev.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      c7c1aecd
    • T
      drm/omap: fix encoder-crtc mapping · 17337297
      Tomi Valkeinen 提交于
      OMAP DSS hardware supports changing the output port to which an overlay
      manager's video stream goes. For example, DPI video stream can come from
      any of the four overlay managers on OMAP5.
      
      However, as it's difficult to manage the change in the driver, the
      omapdss driver does not support that at the moment, and has a hardcoded
      overlay manager per output.
      
      omapdrm, on the other hand, uses the hardware features to find out which
      overlay manager to use for an output, which causes problems. For
      example, on OMAP5, omapdrm tries to use DIGIT overlay manager for DPI
      output, instead of the LCD3 required by the omapdss driver.
      
      This patch changes the omapdrm to use the omapdss driver's hardcoded
      overlay managers, which fixes the issue.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      17337297
  3. 20 3月, 2015 3 次提交
  4. 20 10月, 2014 1 次提交
  5. 10 9月, 2014 1 次提交
  6. 05 6月, 2014 1 次提交
  7. 14 4月, 2014 3 次提交
    • 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 DMM driver (un)registration · ea7e3a66
      Tomi Valkeinen 提交于
      At the moment the DMM driver is never unregistered, even if it's
      registered in the omapdrm module's init function. This means we'll get
      errors when reloading the omapdrm module.
      
      Fix this by unregistering the DMM driver properly, and also change the
      module init to fail if DMM driver cannot be registered, simplifying the
      unregister path as we don't need to keep the state whether we registered
      the DMM driver or not.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      ea7e3a66
    • T
      drm/omap: fix uninit order in pdev_remove() · 707cf58a
      Tomi Valkeinen 提交于
      When unloading omapdrm driver, the omapdrm platform device is
      uninitialized last, after the displays have been disconnected omap_crtc
      callbacks have been removed. As the omapdrm pdev uninitialization needs
      the features uninitialized in earlier steps, a crash is guaranteed.
      
      This patch fixes the uninitialize order so that the omapdrm pdev is
      removed first.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      707cf58a
  8. 09 1月, 2014 3 次提交
    • A
      drm/omap: fix: change dev_unload order · 80e4ed54
      Archit Taneja 提交于
      The current dev_unload order uninits the irqs too early.
      
      In the current sequence, it's possible that a crtc queues work(apply_worker)
      to display a buffer, which registers to omap_crtc_apply_irq to notfiy the
      completion of the configuration we applied.
      
      Calling drm_vblank_cleanup and omap_drm_irq_uninstall here causes the crtc's
      apply handler to never get called, which results in an incorrect state of the
      apply_irq.registered parameter.
      
      This condition occurs where there is no mode set via omapdrm, and dev_lastclose
      tries to set a default fb mode via drm_fb_helper_restore_fbdev_mode. The apply
      work scheduled by restore_fbdev_mode is very close in time to the disabling of
      the irq handler, and hence leads to a race condition. We move the irq cleanup
      at the end of the unload sequence to prevent this.
      
      Also, the call to flush_workqueue is removed since it's called internally by
      destroy_workqueue.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      80e4ed54
    • A
      drm/omap: fix: disconnect devices when omapdrm module is removed · cc823bdc
      Archit Taneja 提交于
      At omapdrm probe, we install manager ops and connect omapdss devices. This
      needs to be undone when omapdrm module is removed so that omapdss is in a
      clean state. This ensures that we can re-insert omapdrm module, or some other
      module which uses omapdss(like omapfb/omap_vout).
      
      Currently, omapdrm's remove neither uninstalls manager ops, or disconnects
      omapdss devices. We make sure that this is done in pdev_remove.
      
      omapdrm establishes connections for omap_dss_device devices when probed. It
      should also be responsible to disconnect the devices. Keeping the devices
      connected can prevent the panel driver modules from unloading, it also causes
      issues when we try to remove or re-insert omapdrm module.
      Signed-off-by: NArchit Taneja <archit@ti.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      cc823bdc
    • 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
  9. 18 12月, 2013 1 次提交
  10. 09 10月, 2013 1 次提交
    • D
      drm: kill ->gem_init_object() and friends · 16eb5f43
      David Herrmann 提交于
      All drivers embed gem-objects into their own buffer objects. There is no
      reason to keep drm_gem_object_alloc(), gem->driver_private and
      ->gem_init_object() anymore.
      
      New drivers are highly encouraged to do the same. There is no benefit in
      allocating gem-objects separately.
      
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Ben Skeggs <skeggsb@gmail.com>
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      16eb5f43
  11. 19 8月, 2013 2 次提交
    • D
      drm: remove FASYNC support · b0e898ac
      Daniel Vetter 提交于
      So I've stumbled over drm_fasync and wondered what it does. Digging
      that up is quite a story.
      
      First I've had to read up on what this does and ended up being rather
      bewildered why peopled loved signals so much back in the days that
      they've created SIGIO just for that ...
      
      Then I wondered how this ever works, and what that strange "No-op."
      comment right above it should mean. After all calling the core fasync
      helper is pretty obviously not a noop. After reading through the
      kernels FASYNC implementation I've noticed that signals are only sent
      out to the processes attached with FASYNC by calling kill_fasync.
      
      No merged drm driver has ever done that.
      
      After more digging I've found out that the only driver that ever used
      this is the so called GAMMA driver. I've frankly never heard of such a
      gpu brand ever before. Now FASYNC seems to not have been the only bad
      thing with that driver, since Dave Airlie removed it from the drm
      driver with prejudice:
      
      commit 1430163b4bbf7b00367ea1066c1c5fe85dbeefed
      Author: Dave Airlie <airlied@linux.ie>
      Date:   Sun Aug 29 12:04:35 2004 +0000
      
          Drop GAMMA DRM from a great height ...
      
      Long story short, the drm fasync support seems to be doing absolutely
      nothing. And the only user of it was never merged into the upstream
      kernel. And we don't need any fops->fasync callback since the fcntl
      implementation in the kernel already implements the noop case
      correctly.
      
      So stop this particular cargo-cult and rip it all out.
      
      v2: Kill drm_fasync assignments in rcar (newly added) and imx drivers
      (somehow I've missed that one in staging). Also drop the reference in
      the drm DocBook. ARM compile-fail reported by Rob Clark.
      
      v3: Move the removal of dev->buf_asnyc assignment in drm_setup to this
      patch here.
      
      v4: Actually git add ... tsk.
      
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b0e898ac
    • D
      drm/omap: kill firstopen callback · 161695bf
      Daniel Vetter 提交于
      KMS drivers really shouldn't need to do anything on firstopen, so kill
      empty callbacks.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      161695bf
  12. 07 8月, 2013 2 次提交
  13. 17 6月, 2013 6 次提交
    • T
      drm/omap: DVI connector fix · 4635c17d
      Tomi Valkeinen 提交于
      The omapdrm driver currently uses a string comparison to find out if the
      display is a DVI display. This is not reliable, and as we now have a
      specific display type for DVI, let's use that.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      4635c17d
    • T
      OMAPDSS: output: increase refcount in find_output funcs · 820caabf
      Tomi Valkeinen 提交于
      Now that omap_dss_output has been combined into omap_dss_device, we can
      add ref counting for the relevant output functions also.
      
      This patch adds omap_dss_get_device() calls to the various find_output()
      style functions. This, of course, means that the users of those
      find_output functions need to do a omap_dss_put_device() after use.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      820caabf
    • T
      OMAPDSS: combine omap_dss_output into omap_dss_device · 1f68d9c4
      Tomi Valkeinen 提交于
      We currently have omap_dss_device, which represents an external display
      device, sometimes an external encoder, sometimes a panel. Then we have
      omap_dss_output, which represents DSS's output encoder.
      
      In the future with new display device model, we construct a video
      pipeline from the display blocks. To accomplish this, all the blocks
      need to be presented by the same entity.
      
      Thus, this patch combines omap_dss_output into omap_dss_device. Some of
      the fields in omap_dss_output are already found in omap_dss_device, but
      some are not. This means we'll have DSS output specific fields in
      omap_dss_device, which is not very nice. However, it is easier to just
      keep those output specific fields there for now, and after transition to
      new display device model is made, they can be cleaned up easier than
      could be done now.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      1f68d9c4
    • T
      OMAPDSS: Implement display (dis)connect support · a7e71e7f
      Tomi Valkeinen 提交于
      We currently have two steps in panel initialization and startup: probing
      and enabling. After the panel has been probed, it's ready and can be
      configured and later enabled.
      
      This model is not enough with more complex display pipelines, where we
      may have, for example, two panels, of which only one can be used at a
      time, connected to the same video output.
      
      To support that kind of scenarios, we need to add new step to the
      initialization: connect.
      
      This patch adds support for connecting and disconnecting panels. After
      probe, but before connect, no panel ops should be called. When the
      connect is called, a proper video pipeline is established, and the panel
      is ready for use. If some part in the video pipeline is already
      connected (by some other panel), the connect call fails.
      
      One key difference with the old style setup is that connect() handles
      also connecting to the overlay manager. This means that the omapfb (or
      omapdrm) no longer needs to figure out which overlay manager to use, but
      it can just call connect() on the panel, and the proper overlay manager
      is connected by omapdss.
      
      This also allows us to add back the support for dynamic switching
      between two exclusive panels. However, the current panel device model is
      not changed to support this, as the new device model is implemented in
      the following patches and the old model will be removed. The new device
      model supports dynamic switching.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      a7e71e7f
    • T
      OMAPDRM: fix overlay manager handling · 04b1fc02
      Tomi Valkeinen 提交于
      Currently omapdrm creates crtcs, which map directly to DSS overlay
      managers, only on demand at init time. This would make it difficult to
      manage connecting the display entities in the future, as the code cannot
      just search for a suitable overlay manager.
      
      We cannot fix this the sane way, which would be to create crtcs for each
      overlay manager, because we need an overlay for each crtc. With limited
      number of overlays, that's not possible.
      
      So the solution for now is to detach the overlay manager from the crtc.
      crtcs are still created on demand at init time, but all overlay managers
      are always initialized by the omapdss.
      
      This way we can create and connect whole display pipelines from the
      overlay manager to the display, regardless of which crtcs omapdrm would
      create.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      04b1fc02
    • T
      OMAPDSS: add helpers to get mgr or output from display · be8e8e1c
      Tomi Valkeinen 提交于
      Add two helper functions that can be used to find either the DSS output
      or the overlay manager that is connected to the given display.
      
      This hides how the output and the manager are actually connected, making
      it easier to change the connections in the future.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      be8e8e1c