1. 27 3月, 2015 3 次提交
  2. 14 2月, 2015 1 次提交
    • R
      drm: add support for tiled/compressed/etc modifier in addfb2 · e3eb3250
      Rob Clark 提交于
      In DRM/KMS we are lacking a good way to deal with tiled/compressed
      formats.  Especially in the case of dmabuf/prime buffer sharing, where
      we cannot always rely on under-the-hood flags passed to driver specific
      gem-create ioctl to pass around these extra flags.
      
      The proposal is to add a per-plane format modifier.  This allows to, if
      necessary, use different tiling patters for sub-sampled planes, etc.
      The format modifiers are added at the end of the ioctl struct, so for
      legacy userspace it will be zero padded.
      
      v1: original
      v1.5: increase modifier to 64b
      
      v2: Incorporate review comments from the big thread, plus a few more.
      
      - Add a getcap so that userspace doesn't have to jump through hoops.
      - Allow modifiers only when a flag is set. That way drivers know when
        they're dealing with old userspace and need to fish out e.g. tiling
        from other information.
      - After rolling out checks for ->modifier to all drivers I've decided
        that this is way too fragile and needs an explicit opt-in flag. So
        do that instead.
      - Add a define (just for documentation really) for the "NONE"
        modifier. Imo we don't need to add mask #defines since drivers
        really should only do exact matches against values defined with
        fourcc_mod_code.
      - Drop the Samsung tiling modifier on Rob's request since he's not yet
        sure whether that one is accurate.
      
      v3:
      - Also add a new ->modifier[] array to struct drm_framebuffer and fill
        it in drm_helper_mode_fill_fb_struct. Requested by Tvrkto Uruslin.
      - Remove TODO in comment and add code comment that modifiers should be
        properly documented, requested by Rob.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Daniel Stone <daniel@fooishbar.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Michel Dänzer <michel@daenzer.net>
      Signed-off-by: Rob Clark <robdclark@gmail.com> (v1.5)
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Stone <daniels@collabora.com>
      Acked-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      e3eb3250
  3. 05 1月, 2015 4 次提交
    • D
      drm: Ensure universal_planes is set for atomic · 179f158c
      Daniel Vetter 提交于
      Atomic doesn't really work without universal planes anyway. But make
      sure that evil userspace doesn't pull the kernel over the table
      because we didn't consider a cornercase that just doesn't make sense,
      just for safety.
      
      v2: Just force ->universal_planes to the same value to avoid imposing
      restrictions on userspace.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      179f158c
    • D
      drm/atomic: Hide drm.ko internal interfaces · a97df1cc
      Daniel Vetter 提交于
      This is just a bit fallout from patch polishing and moving the
      get_prop logic fully into the core:
      - Drop EXPORT_SYMBOL and make the helpers static.
      - Drop kerneldoc since not used by drivers.
      - Move the cross-file function declarations only used by drm.ko
        internally to an internal header.
      
      v2: keep the gist of the comments, requested by Rob.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      a97df1cc
    • R
      drm: Atomic modeset ioctl · d34f20d6
      Rob Clark 提交于
      The atomic modeset ioctl can be used to push any number of new values
      for object properties. The driver can then check the full device
      configuration as single unit, and try to apply the changes atomically.
      
      The ioctl simply takes a list of object IDs and property IDs and their
      values.
      
      Originally based on a patch from Ville Syrjälä, although it has mutated
      (mutilated?) enough since then that you probably shouldn't blame it on
      him ;-)
      
      The atomic support is hidden behind the DRM_CLIENT_CAP_ATOMIC cap (to
      protect legacy userspace) and drm.atomic module param (for now).
      
      v2: Check for file_priv->atomic to make sure we only allow userspace
      in-the-know to use atomic.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d34f20d6
    • R
      drm: add atomic properties · 88a48e29
      Rob Clark 提交于
      Once a driver is using atomic helpers for modeset, the next step is to
      switch over to atomic properties.  To do this, make sure that any
      modeset objects have their ->atomic_{get,set}_property() vfuncs suitably
      populated if they have custom properties (you did already remember to
      plug in atomic-helper func for the legacy ->set_property() vfuncs,
      right?), and then set DRIVER_ATOMIC bit in driver_features flag.
      
      A new cap is introduced, DRM_CLIENT_CAP_ATOMIC, for the purposes of
      shielding legacy userspace from atomic properties.  Mostly for the
      benefit of legacy DDX drivers that do silly things like getting/setting
      each property at startup (since some of the new atomic properties will
      be able to trigger modeset).
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      [danvet: Squash in fixup patch to check for DRM_MODE_PROP_ATOMIC
      instaed of the CAP define when filtering properties. Reported by
      Tvrtko Uruslin, acked by Rob.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      88a48e29
  4. 12 9月, 2014 3 次提交
  5. 10 9月, 2014 5 次提交
  6. 08 8月, 2014 1 次提交
    • D
      Revert "drm: drop redundant drm_file->is_master" · 7963e9db
      Dave Airlie 提交于
      This reverts commit 48ba8137.
      
      Thanks to Chris:
      "drm_file->is_master is not synomous with having drm_file->master ==
      drm_file->minor->master. This is because drm_file->master is the same
      for all drm_files of the same generation and so when there is a master,
      every drm_file believes itself to be the master. Confusion ensues and
      things go pear shaped when one file is closed and there is no master
      anymore."
      
      Conflicts:
      	drivers/gpu/drm/drm_drv.c
      	drivers/gpu/drm/drm_stub.c
      7963e9db
  7. 06 8月, 2014 1 次提交
  8. 05 8月, 2014 1 次提交
  9. 08 7月, 2014 1 次提交
  10. 06 6月, 2014 1 次提交
  11. 23 4月, 2014 2 次提交
  12. 02 4月, 2014 1 次提交
  13. 19 2月, 2014 1 次提交
    • A
      drm: add DRM_CAPs for cursor size · 8716ed4e
      Alex Deucher 提交于
      Some hardware may not support standard 64x64 cursors.  Add
      a drm cap to query the cursor size from the kernel.  Some examples
      include radeon CIK parts (128x128 cursors) and armada (32x64 or 64x32).
      This allows things like device specific ddxes to remove asics specific
      logic and also allows xf86-video-modesetting to work properly with hw
      cursors on this hardware. Default to 64 if the driver doesn't specify
      a size.
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      8716ed4e
  14. 01 10月, 2013 2 次提交
  15. 30 8月, 2013 1 次提交
  16. 19 8月, 2013 3 次提交
    • D
      drm: no-op out GET_STATS ioctl · d79cdc83
      Daniel Vetter 提交于
      Again only used by a tests in libdrm and by dristat. Nowadays we have
      much better tracing tools to get detailed insights into what a drm
      driver is doing. And for a simple "does it work" kind of question that
      these stats could answer we have plenty of dmesg debug log spew.
      
      So I don't see any use for this stat gathering complexity at all.
      
      To be able to gradually drop things start with ripping out the
      interfaces to it, here the ioctl.
      
      To prevent dristat from eating its own stack garbage we can't use the
      drm_noop ioctl though, since we need to clear the return data with a
      memset.
      
      Cc: Eric Anholt <eric@anholt.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d79cdc83
    • D
      drm: hollow-out GET_CLIENT ioctl · 719524df
      Daniel Vetter 提交于
      We not only have debugfs files to do pretty much the equivalent of
      lsof, we also have an ioctl. Not that compared to lsof this dumps a
      wee bit more information, but we can still get at that from debugfs
      easily.
      
      I've dug around in mesa, libdrm and ddx histories and the only users
      seem to be drm/tests/dristat.c and drm/tests/getclients.c. The later
      is a testcase for the ioctl itself since up to
      
      commit b018fcda
      Author: Eric Anholt <eric@anholt.net>
      Date:   Thu Nov 22 18:46:54 2007 +1000
      
          drm: Make DRM_IOCTL_GET_CLIENT return EINVAL when it can't find client #idx
      
      there was actually no way at all for userspace to enumerate all
      clients since the kernel just wouldn't tell it when to stop. Which
      completely broke it's only user, dristat -c.
      
      So obviously that ioctl wasn't much use for debugging. Hence I don't
      see any point in keeping support for a tool which was pretty obviously
      never really used, and while we have good replacements in the form of
      equivalent debugfs files.
      
      Still, to keep dristat -c from looping forever again stop it early by
      returning an unconditional -EINVAL. Also add a comment in the code
      about why.
      
      v2: Slightly less hollowed-out implementation. libva uses GET_CLIENTS
      to figure out whether the fd it has is already authenticated or not.
      So we need to keep that part of things working. Simplest way is to
      just return one entry to keep va_drm_is_authenticated in
      libva/va/drm/va_drm_auth.c working.
      
      This is exercised by igt/drm_get_client_auth which contains a
      copypasta of the libva auth check code.
      
      Cc: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      719524df
    • D
      drm: kill dev->driver->set_version · 45886af2
      Daniel Vetter 提交于
      Totally unused, so just rip it out. Anyway, we want drivers to be
      fully backwards compatible, allowing them to change behaviour is just
      a recipe for them to break badly.
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      45886af2
  17. 31 5月, 2013 1 次提交
  18. 20 11月, 2012 1 次提交
    • I
      drm: add support for monotonic vblank timestamps · c61eef72
      Imre Deak 提交于
      Jumps in the vblank and page flip event timestamps cause trouble for
      clients, so we should avoid them. The timestamp we get currently with
      gettimeofday can jump, so use instead monotonic timestamps.
      
      For backward compatibility use a module flag to revert back to using
      gettimeofday timestamps. Add also a DRM_CAP_TIMESTAMP_MONOTONIC flag
      that is simply a read only version of the module flag, so that clients
      can query this without depending on sysfs.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c61eef72
  19. 03 10月, 2012 1 次提交
  20. 14 9月, 2012 1 次提交
  21. 18 5月, 2012 1 次提交
  22. 17 2月, 2012 1 次提交
    • D
      drm: add some caps for userspace to discover more info for dumb KMS driver (v2) · 019d96cb
      Dave Airlie 提交于
      For the simple KMS driver case we need some more info about what the preferred
      depth and if a shadow framebuffer is preferred.
      
      I've only added this for intel/radeon which support the dumb ioctls so far.
      
      If you need something really fancy you should be writing a real X.org driver.
      
      v2: drop cursor information, just return an error from the cursor ioctls
      and we can make userspace fallback to sw cursor in that case, cursor
      info was getting too messy, best to start smaller.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      019d96cb
  23. 18 1月, 2012 1 次提交
  24. 05 1月, 2012 1 次提交
    • I
      drm: make DRM_UNLOCKED ioctls with their own mutex · 09b4ea47
      Ilija Hadzic 提交于
      drm_getclient, drm_getstats and drm_getmap (with a few minor
      adjustments) do not need global mutex, so fix that and
      make the said ioctls DRM_UNLOCKED. Details:
      
        drm_getclient: the only thing that should be protected here
        is dev->filelist and that is already protected everywhere with
        dev->struct_mutex.
      
        drm_getstats: there is no need for any mutex here because the
        loop runs through quasi-static (set at load time only)
        data, and the actual count access is done with atomic_read()
      
        drm_getmap already uses dev->struct_mutex to protect
        dev->maplist, which also used to protect the same structure
        everywhere else except at three places:
        * drm_getsarea, which doesn't grab *any* mutex before
          touching dev->maplist (so no drm_global_mutex doesn't help
          here either; different issue for a different patch).
          However, drivers seem to call it only at
          initialization time so it probably doesn't matter
        * drm_master_destroy, which is called from drm_master_put,
          which in turn is protected with dev->struct_mutex
          everywhere else in drm module, so we are good here too.
        * drm_getsareactx, which releases the dev->struct_mutex
          too early, but this patch includes the fix for that.
      
      v2: * incorporate comments received from Daniel Vetter
          * include the (long) explanation above to make it clear what
            we are doing (and why), also at Daniel Vetter's request
          * tighten up mutex grab/release locations to only
            encompass real critical sections, rather than some
            random code around them
      Signed-off-by: NIlija Hadzic <ihadzic@research.bell-labs.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      09b4ea47
  25. 24 3月, 2011 1 次提交