1. 10 9月, 2014 1 次提交
  2. 20 8月, 2014 1 次提交
    • T
      drm: fix plane rotation when restoring fbdev configuration · 3a5f87c2
      Thomas Wood 提交于
      Make sure plane rotation is reset correctly when restoring the fbdev
      configuration by using drm_mode_plane_set_obj_prop which calls the
      driver's set_property callback.
      
      The rotation reset feature was introduced in commit 9783de20 (drm:
      Resetting rotation property) and the callback issue was originally
      addressed in a previous version of the patch, but the fix was not
      present in the final version.
      
      v2: Fix documentation warning
          Add some more details to the commit message (Daniel Vetter)
      
      Testcase: igt/kms_rotation_crc
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82236
      Cc: Sonika Jindal <sonika.jindal@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThomas Wood <thomas.wood@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3a5f87c2
  3. 11 8月, 2014 1 次提交
    • D
      drm: Add a plane->reset hook · 2a0d7cfd
      Daniel Vetter 提交于
      In general having this can't hurt, and the atomic helpers will need
      it to be able to reset the state objects properly. The overall idea
      is to reset in the order pixels flow, so planes -> crtcs ->
      encoders -> connectors.
      
      v2: Squash in fixup from Ville to correctly deference struct drm_plane
      instead of drm_crtc when walking the plane list. Fixes an oops in
      driver init and resume.
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2a0d7cfd
  4. 08 8月, 2014 5 次提交
  5. 06 8月, 2014 1 次提交
    • C
      drm: Perform cmdline mode parsing during connector initialisation · eaf99c74
      Chris Wilson 提交于
      i915.ko has a custom fbdev initialisation routine that aims to preserve
      the current mode set by the BIOS, unless overruled by the user. The
      user's wishes are determined by what, if any, mode is specified on the
      command line (via the video= parameter). However, that command line mode
      is first parsed by drm_fb_helper_initial_config() which is called after
      i915.ko's custom initial_config() as a fallback method. So in order for
      us to honour it, we need to move the cmdline parser earlier. If we
      perform the connector cmdline parsing as soon as we initialise the
      connector, that cmdline mode and forced status is then available even if
      the fbdev helper is not compiled in or never called.
      
      We also then expose the cmdline user mode in the connector mode lists.
      
      v2: Rebase after connector->name upheaval.
      
      v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely
      simplifies things while at that.
      
      v4: Fix checkpatch.
      
      v5: Select FB_CMDLINE to adapt to the changed fbdev patch.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2)
      Cc: dri-devel@lists.freedesktop.org
      Cc: Julia Lemire <jlemire@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eaf99c74
  6. 23 7月, 2014 1 次提交
  7. 12 7月, 2014 4 次提交
  8. 11 7月, 2014 1 次提交
  9. 08 7月, 2014 2 次提交
  10. 19 6月, 2014 3 次提交
  11. 13 6月, 2014 2 次提交
    • M
      drm: Allow drivers to register cursor planes with crtc · fc1d3e44
      Matt Roper 提交于
      Universal plane support had placeholders for cursor planes, but didn't
      actually do anything with them.  Save the cursor plane reference inside
      the crtc and update the cursor plane parameter from void* to drm_plane.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: Pallavi G<pallavi.g@intel.com>
      Acked-by: NDave Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fc1d3e44
    • M
      drm: Support legacy cursor ioctls via universal planes when possible (v4) · 161d0dc1
      Matt Roper 提交于
      If drivers support universal planes and have registered a cursor plane
      with the DRM core, we should use that universal plane support when
      handling legacy cursor ioctls.  Drivers that transition to universal
      planes won't have to maintain separate legacy ioctl handling; drivers
      that don't transition to universal planes will continue to operate
      without any change to behavior.
      
      Note that there's a bit of a mismatch between the legacy cursor ioctls
      and the universal plane API's --- legacy ioctl's use driver buffer
      handles directly whereas the universal plane API takes drm_framebuffers.
      Since there's no way to recover the driver handle from a
      drm_framebuffer, we can implement legacy ioctl's in terms of universal
      plane interfaces, but cannot implement universal plane interfaces in
      terms of legacy ioctls.  Specifically, there's no way to create a
      general cursor helper in the way we previously created a primary plane
      helper.
      
      It's important to land this patch before any patches that add universal
      cursor support to individual drivers so that drivers don't have to worry
      about juggling two different styles of reference counting for cursor
      buffers when userspace mixes and matches legacy and universal cursor
      calls.  With this patch, a driver that switches to universal cursor
      support may assume that all cursor buffers are wrapped in a
      drm_framebuffer and can rely on framebuffer reference counting for all
      cursor operations.
      
      v4:
       - Add comments pointing out setplane_internal's reference-eating
         semantics.
      v3:
       - Drop drm_mode_rmfb() call that is no longer needed now that we're
         using setplane_internal(), which takes care of deref'ing the
         appropriate framebuffer.
      v2:
       - Use new add_framebuffer_internal() function to create framebuffer
         rather than trying to call directly into the ioctl interface and
         look up the handle returned.
       - Use new setplane_internal() function to update the cursor plane
         rather than calling through the ioctl interface.  Note that since
         we're no longer looking up an fb_id, no extra reference will be
         taken here.
       - Grab extra reference to fb under lock in !BO case to avoid issues
         where racing userspace could cause the fb to be destroyed out from
         under us after we grab the fb pointer.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: Pallavi G<pallavi.g@intel.com>
      Acked-by: NDave Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      161d0dc1
  12. 10 6月, 2014 1 次提交
  13. 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
  14. 04 6月, 2014 6 次提交
    • D
      drm: Split connection_mutex out of mode_config.mutex (v3) · 6e9f798d
      Daniel Vetter 提交于
      After the split-out of crtc locks from the big mode_config.mutex
      there's still two major areas it protects:
      - Various connector probe states, like connector->status, EDID
        properties, probed mode lists and similar information.
      - The links from connector->encoder and encoder->crtc and other
        modeset-relevant connector state (e.g. properties which control the
        panel fitter).
      
      The later is used by modeset operations. But they don't really care
      about the former since it's allowed to e.g. enable a disconnected VGA
      output or with a mode not in the probed list.
      
      Thus far this hasn't been a problem, but for the atomic modeset
      conversion Rob Clark needs to convert all modeset relevant locks into
      w/w locks. This is required because the order of acquisition is
      determined by how userspace supplies the atomic modeset data. This has
      run into troubles in the detect path since the i915 load detect code
      needs _both_ protections offered by the mode_config.mutex: It updates
      probe state and it needs to change the modeset configuration to enable
      the temporary load detect pipe.
      
      The big deal here is that for the probe/detect users of this lock a
      plain mutex fits best, but for atomic modesets we really want a w/w
      mutex. To fix this lets split out a new connection_mutex lock for the
      modeset relevant parts.
      
      For simplicity I've decided to only add one additional lock for all
      connector/encoder links and modeset configuration states. We have
      piles of different modeset objects in addition to those (like bridges
      or panels), so adding per-object locks would be much more effort.
      
      Also, we're guaranteed (at least for now) to do a full modeset if we
      need to acquire this lock. Which means that fine-grained locking is
      fairly irrelevant compared to the amount of time the full modeset will
      take.
      
      I've done a full audit, and there's just a few things that justify
      special focus:
      - Locking in drm_sysfs.c is almost completely absent. We should
        sprinkle mode_config.connection_mutex over this file a bit, but
        since it already lacks mode_config.mutex this patch wont make the
        situation any worse. This is material for a follow-up patch.
      
      - omap has a omap_framebuffer_flush function which walks the
        connector->encoder->crtc links and is called from many contexts.
        Some look like they don't acquire mode_config.mutex, so this is
        already racy. Again fixing this is material for a separate patch.
      
      - The radeon hot_plug function to retrain DP links looks at
        connector->dpms. Currently this happens without any locking, so is
        already racy. I think radeon_hotplug_work_func should gain
        mutex_lock/unlock calls for the mode_config.connection_mutex.
      
      - Same applies to i915's intel_dp_hot_plug. But again, this is already
        racy.
      
      - i915 load_detect code needs to acquire this lock. Which means the
        w/w dance due to Rob's work will be nicely contained to _just_ this
        function.
      
      I've added fixme comments everywhere where it looks suspicious but in
      the sysfs code. After a quick irc discussion with Dave Airlie it
      sounds like the lack of locking in there is due to sysfs cleanup fun
      at module unload.
      
      v1: original (only compile tested)
      
      v2: missing mutex_init(), etc (from Rob Clark)
      
      v3: i915 needs more care in the conversion:
      - Protect the edp pp logic with the connection_mutex.
      - Use connection_mutex in the backlight code due to
        get_pipe_from_connector.
      - Use drm_modeset_lock_all in suspend/resume paths.
      - Update lock checks in the overlay code.
      
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      6e9f798d
    • R
      drm: add signed-range property type · ebc44cf3
      Rob Clark 提交于
      Like range, but values are signed.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      ebc44cf3
    • R
      drm: add object property type · 98f75de4
      Rob Clark 提交于
      An object property is an id (idr) for a drm mode object.  This
      will allow a property to be used set/get a framebuffer, CRTC, etc.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      98f75de4
    • R
      drm: add extended property types · 5ea22f24
      Rob Clark 提交于
      If we continue to use bitmask for type, we will quickly run out of room
      to add new types.  Split this up so existing part of bitmask range
      continues to function as before, but reserve a chunk of the remaining
      space for an integer type-id.  Wrap this all up in some type-check
      helpers to keep the backwards-compat uglyness contained.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5ea22f24
    • R
      drm: helpers to find mode objects · a2b34e22
      Rob Clark 提交于
      Add a few more useful helpers to find mode objects.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a2b34e22
    • J
      drm: drop drm_get_connector_name() and drm_get_encoder_name() · d5ab2b43
      Jani Nikula 提交于
      No longer used or needed as the structs have a name field.
      Acked-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d5ab2b43
  15. 30 5月, 2014 2 次提交
  16. 16 5月, 2014 1 次提交
  17. 22 4月, 2014 1 次提交
    • V
      drm/edid: Fill PAR in AVI infoframe based on CEA mode list · 0967e6a5
      Vandana Kannan 提交于
      Populate PAR in infoframe structure. If there is a user setting for PAR, then
      that value is set. Else, value is taken from CEA mode list if VIC is found.
      Else, PAR is calculated from resolution. If none of these conditions are
      satisfied, PAR is NONE as per initialization.
      
      v2: Removed the part which sets PAR according to user input, based on
      Daniel's review comments.
      
      A separate patch will be submitted to create a property that would enable a
      user space app to set aspect ratio for AVI infoframe.
      
      v2: Removed the part which sets PAR according to user input, based on
      Daniel's review comments.
      
      v3: Removed calculation of PAR for non-CEA modes as per discussion with
      Ville.
      
      A separate patch will be submitted to create a property that would enable a
      user space app to set aspect ratio for AVI infoframe.
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Jesse Barnes <jesse.barnes@intel.com>
      Cc: Vijay Purushothaman <vijay.a.purushothaman@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Squash in fixup for htmldocs.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0967e6a5
  18. 02 4月, 2014 6 次提交