1. 14 Jan, 2014 1 commit
  2. 19 Aug, 2013 2 commits
    • Daniel Vetter's avatar
      drm: rip out drm_core_has_MTRR checks · 28185647
      Daniel Vetter authored
      
      The new arch_phys_wc_add/del functions do the right thing both with
      and without MTRR support in the kernel. So we can drop these
      additional checks.
      
      David Herrmann suggest to also kill the DRIVER_USE_MTRR flag since
      it's now unused, which spurred me to do a bit a better audit of the
      affected drivers. David helped a lot in that. Quoting our mail
      discussion:
      
      On Wed, Jul 10, 2013 at 5:41 PM, David Herrmann <dh.herrmann@gmail.com> wrote:
      > On Wed, Jul 10, 2013 at 5:22 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
      >> On Wed, Jul 10, 2013 at 3:51 PM, David Herrmann <dh.herrmann@gmail.com> wrote:
      >>>> -#if __OS_HAS_MTRR
      >>>> -static inline int drm_core_has_MTRR(struct drm_device *dev)
      >>>> -{
      >>>> -       return drm_core_check_feature(dev, DRIVER_USE_MTRR);
      >>>> -}
      >>>> -#else
      >>>> -#define drm_core_has_MTRR(dev) (0)
      >>>> -#endif
      >>>> -
      >>>
      >>> That was the last user of DRIVER_USE_MTRR (apart from drivers setting
      >>> it in .driver_features). Any reason to keep it around?
      >>
      >> Yeah, I guess we could rip things out. Which will also force me to
      >> properly audit drivers for the eventual behaviour change this could
      >> entail (in case there's an x86 driver which did not ask for an mtrr,
      >> but iirc there isn't).
      >
      > david@david-mb ~/dev/kernel/linux $ for i in drivers/gpu/drm/* ; do if
      > test -d "$i" ; then if ! grep -q USE_MTRR -r $i ; then echo $i ; fi ;
      > fi ; done
      > drivers/gpu/drm/exynos
      > drivers/gpu/drm/gma500
      > drivers/gpu/drm/i2c
      > drivers/gpu/drm/nouveau
      > drivers/gpu/drm/omapdrm
      > drivers/gpu/drm/qxl
      > drivers/gpu/drm/rcar-du
      > drivers/gpu/drm/shmobile
      > drivers/gpu/drm/tilcdc
      > drivers/gpu/drm/ttm
      > drivers/gpu/drm/udl
      > drivers/gpu/drm/vmwgfx
      > david@david-mb ~/dev/kernel/linux $
      >
      > So for x86 gma500,nouveau,qxl,udl,vmwgfx don't set DRIVER_USE_MTRR.
      > But I cannot tell whether they break if we call arch_phys_wc_add/del,
      > anyway. At least nouveau seemed to work here, but it doesn't use AGP
      > or drm_bufs, I guess.
      
      Cool, thanks a lot for stitching together the list of drivers to look
      at. So for real KMS drivers it's the drives responsibility to add an
      mtrr if it needs one. nouvea, radeon, mgag200, i915 and vmwgfx do that
      already. Somehow the savage driver also ends up doing that, I have no
      idea why.
      
      Note that gma500 as a pure KMS driver doesn't need MTRR setup since
      the platforms that it supports all support PAT. So no MTRRs needed to
      get wc iomappings.
      
      The mtrr support in the drm core is all for legacy mappings of garts,
      framebuffers and registers. All legacy drivers set the USE_MTRR flag,
      so we're good there.
      
      All in all I think we can really just ditch this
      
      /endquote
      
      v2: Also kill DRIVER_USE_MTRR as suggested by David Herrmann
      
      v3: Rebase on top of David Herrmann's agp setup/cleanup changes.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      28185647
    • Daniel Vetter's avatar
      drm: remove FASYNC support · b0e898ac
      Daniel Vetter authored
      
      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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      b0e898ac
  3. 02 Oct, 2012 1 commit
  4. 05 Sep, 2012 1 commit
    • Keith Packard's avatar
      drm: use drm_compat_ioctl for 32-bit apps · 804d74ab
      Keith Packard authored
      
      Most of the DRM drivers appear to be missing the .compat_ioctl file
      operation entry necessary for 32-bit application compatibility.
      
      This patch  uses drm_compat_ioctl for all drivers which don't have
      their own, and which are using drm_ioctl for .unlocked_ioctl.
      
      This leaves drivers/gpu/drm/psb/psb_drv.c unchanged; it has a custom
      .unlocked_ioctl and will presumably need a custom .compat_ioctl as
      well.
      Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: default avatarDave Airlie <airlied@gmail.com>
      804d74ab
  5. 20 Jul, 2012 1 commit
    • Daniel Vetter's avatar
      drm/via: clean up reclaim_buffers · 834859c3
      Daniel Vetter authored
      
      A few things
      - kill reclaim_buffers, it's never ever called because via does not set
        DRIVER_HAVE_DMA
      - inline the idlelock dance into the buffer reclaim logic and make it
        a simple preclose cleanup function
      - directly call the the dma_quiescent function and kill the needless
        if check.
      
      v2: Actually drop the idlelock when we take it. Reported by James
      Simmons.
      
      v3: Rebased onto latest drm-next.
      
      v4: Fixup the refactor.
      
      v5: More fixup the refactor - I've accidentally changed the check for
      any master to checking whether the closing fd is the master.
      
      v6: Don't forget to drop the idlelock in the early return path, too.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      834859c3
  6. 21 Dec, 2011 1 commit
  7. 11 Nov, 2011 1 commit
    • Arjan van de Ven's avatar
      drm: Make the per-driver file_operations struct const · e08e96de
      Arjan van de Ven authored
      
      From fdf1fdebaa00f81de18c227f32f8074c8b352d50 Mon Sep 17 00:00:00 2001
      From: Arjan van de Ven <arjan@linux.intel.com>
      Date: Sun, 30 Oct 2011 19:06:07 -0700
      Subject: [PATCH] drm: Make the per-driver file_operations struct const
      
      The DRM layer keeps a copy of struct file_operations inside its
      big driver struct... which prevents it from being consistent and static.
      For consistency (and the general security objective of having such things
      static), it's desirable to get this fixed.
      
      This patch splits out the file_operations field to its own struct,
      which is then "static const", and just stick a pointer to this into
      the driver struct, making it more consistent with how the rest of the
      kernel does this.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      e08e96de
  8. 31 Oct, 2011 1 commit
  9. 07 Feb, 2011 1 commit
  10. 16 Sep, 2010 1 commit
    • Arnd Bergmann's avatar
      drm: use noop_llseek · dc880abe
      Arnd Bergmann authored
      
      The drm device drivers currently allow seeking on the
      character device but never care about the actual
      file position.
      
      When we change the default llseek operation to be
      no_llseek, calling llseek on a drm device would
      return an error condition, which is an API change.
      
      Explicitly setting noop_llseek lets us keep the
      current API.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: dri-devel@lists.freedesktop.org
      dc880abe
  11. 29 Aug, 2010 2 commits
  12. 18 Dec, 2009 1 commit
    • Arnd Bergmann's avatar
      drm: convert drm_ioctl to unlocked_ioctl · ed8b6704
      Arnd Bergmann authored
      
      drm_ioctl is called with the Big Kernel Lock held,
      which shows up very high in statistics on vfs_ioctl.
      
      Moving the lock into the drm_ioctl function itself
      makes sure we blame the right subsystem and it gets
      us one step closer to eliminating the locked version
      of fops->ioctl.
      
      Since drm_ioctl does not require the lock itself,
      we only need to hold it while calling the specific
      handler. The 32 bit conversion handlers do not
      interact with any other code, so they don't need
      the BKL here either and can just call drm_ioctl.
      
      As a bonus, this cleans up all the other users
      of drm_ioctl which now no longer have to find
      the inode or call lock_kernel.
      
      [airlied: squashed the non-driver bits
      of the second patch in here, this provides
      the flag for drivers to use to select unlocked
      ioctls - but doesn't modify any drivers].
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: dri-devel@lists.sourceforge.net
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      ed8b6704
  13. 13 Mar, 2009 1 commit
    • Kristian Høgsberg's avatar
      drm: Drop unused and broken dri_library_name sysfs attribute. · 8e100458
      Kristian Høgsberg authored
      
      The kernel shouldn't be in the business of telling user space which
      driver to load.  The kernel defers mapping PCI IDs to module names
      to user space and we should do the same for DRI drivers.
      
      And in fact, that's how it does work today.  Nothing uses the
      dri_library_name attribute, and the attribute is in fact broken.
      For intel devices, it falls back to the default behaviour of returning
      the kernel module name as the DRI driver name, which doesn't work for
      i965 devices.  Nobody has ever hit this problem or filed a bug about this.
      Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
      8e100458
  14. 17 Oct, 2008 1 commit
  15. 14 Jul, 2008 1 commit
    • Dave Airlie's avatar
      drm: reorganise drm tree to be more future proof. · c0e09200
      Dave Airlie authored
      
      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: default avatarDave Airlie <airlied@redhat.com>
      c0e09200
  16. 07 May, 2008 1 commit
  17. 26 Apr, 2008 1 commit
    • Jesse Barnes's avatar
      drm/vbl rework: rework how the drm deals with vblank. · ac741ab7
      Jesse Barnes authored
      
      Other Authors: Michel Dänzer <michel@tungstengraphics.com>
      mga: Ian Romanick <idr@us.ibm.com>
      via: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
      
      This re-works the DRM internals to provide a better interface for drivers
      to expose vblank on multiple crtcs.
      
      It also includes work done by Michel on making i915 triple buffering and pageflipping work properly.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      ac741ab7
  18. 07 Feb, 2008 1 commit
  19. 23 Mar, 2007 1 commit
    • Thomas Hellstrom's avatar
      drm: fix driver deadlock with AIGLX and reclaim_buffers_locked · 040ac320
      Thomas Hellstrom authored
      
      Bugzilla Bug #9457
      
      Add refcounting of user waiters to the DRM hardware lock, so that we can use
      DRM_LOCK_CONT flag more conservatively.
      
      Also add a kernel waiter refcount that if nonzero transfers the lock for the
      kernel context when it is released. This is useful when waiting for idle and can be used for very simple fence object driver implementations for the new memory manager
      Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
      040ac320
  20. 21 Sep, 2006 1 commit
  21. 30 Jun, 2006 1 commit
  22. 12 Nov, 2005 1 commit
  23. 11 Nov, 2005 1 commit
  24. 10 Nov, 2005 1 commit
    • Dave Airlie's avatar
      drm: rename driver hooks more understandably · 22eae947
      Dave Airlie authored
      
      Rename the driver hooks in the DRM to something a little more understandable:
      preinit         ->      load
      postinit        ->      (removed)
      presetup        ->      firstopen
      postsetup       ->      (removed)
      open_helper     ->      open
      prerelease      ->      preclose
      free_filp_priv  ->      postclose
      pretakedown     ->      lastclose
      postcleanup     ->      unload
      release         ->      reclaim_buffers_locked
      version         ->      (removed)
      
      postinit and version were replaced with generic code in the Linux DRM (drivers
      now set their version numbers and description in the driver structure, like on
      BSD).  postsetup wasn't used at all.  Fixes the savage hooks for
      initializing and tearing down mappings at the right times.  Testing involved at
      least starting X, running glxgears, killing glxgears, exiting X, and repeating.
      
      Tested on:      FreeBSD (g200, g400, r200, r128)
                      Linux (r200, savage4)
      
      From: Eric Anholt <anholt@freebsd.org>
      Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
      22eae947
  25. 25 Sep, 2005 1 commit
    • Dave Airlie's avatar
      drm: lindent the drm directory. · b5e89ed5
      Dave Airlie authored
      
      I've been threatening this for a while, so no point hanging around.
      This lindents the DRM code which was always really bad in tabbing department.
      I've also fixed some misnamed files in comments and removed some trailing
      whitespace.
      Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
      b5e89ed5
  26. 28 Jun, 2005 1 commit