1. 10 9月, 2014 5 次提交
  2. 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
  3. 06 8月, 2014 1 次提交
  4. 05 8月, 2014 1 次提交
  5. 08 7月, 2014 1 次提交
  6. 06 6月, 2014 1 次提交
  7. 23 4月, 2014 2 次提交
  8. 02 4月, 2014 1 次提交
  9. 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
  10. 01 10月, 2013 2 次提交
  11. 30 8月, 2013 1 次提交
  12. 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
  13. 31 5月, 2013 1 次提交
  14. 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
  15. 03 10月, 2012 1 次提交
  16. 14 9月, 2012 1 次提交
  17. 18 5月, 2012 1 次提交
  18. 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
  19. 18 1月, 2012 1 次提交
  20. 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
  21. 24 3月, 2011 1 次提交
  22. 21 3月, 2011 1 次提交
  23. 04 3月, 2011 2 次提交
  24. 07 2月, 2011 1 次提交
  25. 10 8月, 2010 1 次提交
    • B
      drm: Fix support for PCI domains · c17c2f89
      Benjamin Herrenschmidt 提交于
      (For some reason I thought that went in ages ago ...)
      
      This fixes support for PCI domains in what should hopefully be a backward
      compatible way along with a change to libdrm.
      
      When the interface version is set to 1.4, we assume userspace understands
      domains and the world is at peace. We thus pass proper domain numbers
      instead of 0 to userspace.
      
      The newer libdrm will then try 1.4 first, and fallback to 1.1, along with
      ignoring domains in the later case (well, except on alpha of course)
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c17c2f89
  26. 05 8月, 2010 1 次提交
  27. 01 6月, 2010 1 次提交
  28. 19 6月, 2009 1 次提交
  29. 29 12月, 2008 2 次提交
    • V
      drm: fix leak of uninitialized data to userspace · 1147c9cd
      Vegard Nossum 提交于
      ...so drm_getunique() is trying to copy some uninitialized data to
      userspace. The ECX register contains the number of words that are
      left to copy -- so there are 5 * 4 = 20 bytes left. The offset of the
      first uninitialized byte (counting from the start of the string) is
      also 20 (i.e. 0xf65d2294&((1 << 5)-1) == 20). So somebody tried to
      copy 40 bytes when the string was only 19 long.
      
      In drm_set_busid() we have this code:
      
              dev->unique_len = 40;
              dev->unique = drm_alloc(dev->unique_len + 1, DRM_MEM_DRIVER);
            ...
              len = snprintf(dev->unique, dev->unique_len, pci:%04x:%02x:%02x.%d",
      
      ...so it seems that dev->unique is never updated to reflect the
      actual length of the string. The remaining bytes (20 in this case)
      are random uninitialized bytes that are copied into userspace.
      
      This patch fixes the problem by setting dev->unique_len after the
      snprintf().
      
      airlied- I've had to fix this up to store the alloced size so
      we have it for drm_free later.
      Reported-by: NSitsofe Wheeler <sitsofe@yahoo.com>
      Signed-off-by: NVegard Nossum <vegardno@thuin.ifi.uio.no>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1147c9cd
    • D
      drm: move to kref per-master structures. · 7c1c2871
      Dave Airlie 提交于
      This is step one towards having multiple masters sharing a drm
      device in order to get fast-user-switching to work.
      
      It splits out the information associated with the drm master
      into a separate kref counted structure, and allocates this when
      a master opens the device node. It also allows the current master
      to abdicate (say while VT switched), and a new master to take over
      the hardware.
      
      It moves the Intel and radeon drivers to using the sarea from
      within the new master structures.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      7c1c2871
  30. 14 7月, 2008 1 次提交
    • D
      drm: reorganise drm tree to be more future proof. · c0e09200
      Dave Airlie 提交于
      With the coming of kernel based modesetting and the memory manager stuff,
      the everything in one directory approach was getting very ugly and
      starting to be unmanageable.
      
      This restructures the drm along the lines of other kernel components.
      
      It creates a drivers/gpu/drm directory and moves the hw drivers into
      subdirectores. It moves the includes into an include/drm, and
      sets up the unifdef for the userspace headers we should be exporting.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c0e09200