1. 28 3月, 2014 2 次提交
  2. 16 3月, 2014 1 次提交
    • D
      drm/crtc: add sanity checks to create_dumb() · b28cd41f
      David Herrmann 提交于
      Lets make sure some basic expressions are always true:
        bpp != NULL
        width != NULL
        height != NULL
        stride = bpp * width < 2^32
        size = stride * height < 2^32
        PAGE_ALIGN(size) < 2^32
      
      At least the udl driver doesn't check for multiplication-overflows, so
      lets just make sure it will never happen. These checks allow drivers to do
      any 32bit math without having to test for mult-overflows themselves.
      
      The two divisions might hurt performance a bit, but dumb_create() is only
      used for scanout-buffers, so that should be fine. We could use 64bit math
      to avoid the divisions, but that may be slow on 32bit machines.. Or maybe
      there should just be a "safe_mult32()" helper, which currently doesn't
      exist (I think?).
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      b28cd41f
  3. 13 3月, 2014 4 次提交
    • D
      drm: kerneldoc polish for drm_crtc.c · c8e32cc1
      Daniel Vetter 提交于
      - Standardized on "Returns:" Block.
      - Sprinkle missing kerneldoc over all exported functions and all
        ioctls.
      - Add a stern warning that driver's really shouldn't use
        drm_mode_group_init_legacy_group.
      - Usual attempt at more consistency.
      - Add warnings that drm_mode_object_get/put don't do refcounting,
        despite what the names might lead to believe.
      - Try to clarify the framebuffer setup/cleanup functions wrt driver
        private framebuffers - I've fallen recently over this when reviewing
        i915 fbdev patches.
      - Align function parameters where the kerneldoc has been updated.
      - Most of the drm_get_*_name functions aren't thread safe. Add stern
        warnings where this is the case.
      
      Since a lot of the functions in drm_crtc.c are boilerplate to handle
      properties and create default sets of them it might be useful to
      extract all that code into a new file drm_property.c. Especially since
      properties will be used a lot more in the future.
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c8e32cc1
    • D
      drm: move drm_mode related functions into drm_modes.c · 8bd441b2
      Daniel Vetter 提交于
      Makes more sense and gives better grouping in the DocBook function
      reference sections. To make this possible we need to expose two
      functions from drm_crtc.c though. To avoid further namespace pollution
      in the system wide headers create a new internal header for such drm
      internal symbols.
      
      I expect that longer-term we'll add tons more, but since my goal here
      is to polish the kerneldoc that's for another day.
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8bd441b2
    • D
      drm/doc: Repleace LOCKING kerneldoc sections in drm_modes.c · 63951385
      Daniel Vetter 提交于
      There's not really any value in stating that no locking is needed. And
      even if the comment is useful, a check for the right mutex at the
      beginning of the function is better since that can't be ingored as
      easily as a bit of documentation.
      
      Note that drm_mode_probed_add in drm_crtc.c is also changed, the next
      patch will move this into drm_modes.c
      
      v2: Don't add locking WARN_ONs where it is not strictly required (i.e.
      the two functions to validate/prune mode lists).
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      63951385
    • D
      drm/kms: rip out drm_mode_connector_detach_encoder · 69fa5293
      Daniel Vetter 提交于
      It's only used by imx, and that one gets it wrong - there's no need
      to deteach the encoder before removing it.
      
      And really, neither current drm modesetting code nor all the userspace
      we have can handle dynamic changes in the set of possible encoders for
      a given connector. So let's just remove this before someone starts
      doing something really nasty with it.
      
      As a plus, one less kerneldoc comment to write.
      
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      69fa5293
  4. 13 2月, 2014 1 次提交
  5. 14 1月, 2014 1 次提交
  6. 18 12月, 2013 1 次提交
  7. 06 11月, 2013 3 次提交
  8. 23 10月, 2013 1 次提交
  9. 01 10月, 2013 6 次提交
  10. 04 9月, 2013 1 次提交
  11. 02 9月, 2013 2 次提交
    • D
      drm: fix DRM_IOCTL_MODE_GETFB handle-leak · 101b96f3
      David Herrmann 提交于
      DRM_IOCTL_MODE_GETFB is used to retrieve information about a given
      framebuffer ID. It is a read-only helper and was thus declassified for
      unprivileged access in:
      
        commit a14b1b42
        Author: Mandeep Singh Baines <mandeep.baines@gmail.com>
        Date:   Fri Jan 20 12:11:16 2012 -0800
      
            drm: remove master fd restriction on mode setting getters
      
      However, alongside width, height and stride information,
      DRM_IOCTL_MODE_GETFB also passes back a handle to the underlying buffer of
      the framebuffer. This handle allows users to mmap() it and read or write
      into it. Obviously, this should be restricted to DRM-Master.
      
      With the current setup, *any* process with access to /dev/dri/card0 (which
      means any process with access to hardware-accelerated rendering) can
      access the current screen framebuffer and modify it ad libitum.
      
      For backwards-compatibility reasons we want to keep the
      DRM_IOCTL_MODE_GETFB call unprivileged. Besides, it provides quite useful
      information regarding screen setup. So we simply test whether the caller
      is the current DRM-Master and if not, we return 0 as handle, which is
      always invalid. A following DRM_IOCTL_GEM_CLOSE on this handle will fail
      with EINVAL, but we accept this. Users shouldn't test for errors during
      GEM_CLOSE, anyway. And it is still better as a failing MODE_GETFB call.
      
      v2: add capable(CAP_SYS_ADMIN) check for compatibility with i-g-t
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      101b96f3
    • S
      drm: Add drm_bridge · 3b336ec4
      Sean Paul 提交于
      This patch adds the notion of a drm_bridge. A bridge is a chained
      device which hangs off an encoder. The drm driver using the bridge
      should provide the association between encoder and bridge. Once a
      bridge is associated with an encoder, it will participate in mode
      set, and dpms (via the enable/disable hooks).
      Signed-off-by: NSean Paul <seanpaul@chromium.org>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3b336ec4
  12. 30 8月, 2013 2 次提交
  13. 21 8月, 2013 2 次提交
  14. 19 8月, 2013 1 次提交
  15. 28 6月, 2013 1 次提交
    • D
      drm: add hotspot support for cursors. · 4c813d4d
      Dave Airlie 提交于
      So it looks like for virtual hw cursors on QXL we need to inform
      the "hw" device what the cursor hotspot parameters are. This
      makes sense if you think the host has to draw the cursor and interpret
      clicks from it. However the current modesetting interface doesn't support
      passing the hotspot information from userspace.
      
      This implements a new cursor ioctl, that takes the hotspot info as well,
      userspace can try calling the new interface and if it gets -ENOSYS it means
      its on an older kernel and can just fallback.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      4c813d4d
  16. 25 6月, 2013 2 次提交
    • D
      drm: fix fb leak in setcrtc · 5cef29aa
      Daniel Vetter 提交于
      Drivers are allowed (actually have to) disable unrelated crtcs in
      their ->set_config callback (when we steal all the connectors from
      that crtc). If they do that they'll clear crtc->fb to NULL.
      
      Which results in a refcount leak, since the drm core is keeping track
      of that reference.
      
      To fix this track the old fb of all crtcs and adjust references for
      all of them. Of course, since we only hold an additional reference for
      the fb for the current crtc we need to increase refcounts before we
      drop the old one.
      
      This approach has the benefit that it inches us a bit closer to an
      atomic modeset world, where we want to update the config of all crtcs
      in one step.
      
      This regression has been introduce in the framebuffer refcount
      conversion, specifically in
      
      commit b0d12325
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Dec 11 01:07:12 2012 +0100
      
          drm: refcounting for crtc framebuffers
      Reported-by: NRussell King <linux@arm.linux.org.uk>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5cef29aa
    • D
      drm: check that ->set_config properly updates the fb · cc85e121
      Daniel Vetter 提交于
      Historically drm lacked fb refcounting, so the updating of crtc->fb
      was done by the lower levels at a point convenient to get their own
      refcounting (e.g. refcounts for the underlying gem bo, pinning
      refcounts) right. With the introduction of refcounted fbs the drm core
      handled the fb refcounts, but still relied on drivers to update the
      crtc->fb pointer (this approach required the least invasive changes in
      drivers).
      
      Enforce this contract with a WARN_ON.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      cc85e121
  17. 17 6月, 2013 3 次提交
  18. 11 6月, 2013 4 次提交
  19. 13 5月, 2013 1 次提交
  20. 03 5月, 2013 1 次提交