1. 21 8月, 2013 6 次提交
  2. 19 8月, 2013 34 次提交
    • D
      drm: move dev data clearing from drm_setup to lastclose · f336ab76
      Daniel Vetter 提交于
      We kzalloc this structure, and for real kms devices we should never
      loose track of things really.
      
      But ums/legacy drivers rely on the drm core to clean up a bit of cruft
      between lastclose and firstopen (i.e. when X is being restarted), so
      keep this around. But give it a clear drm_legacy_ prefix and
      conditionalize the code on !DRIVER_MODESET.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      f336ab76
    • D
      drm: remove procfs code, take 2 · cb6458f9
      Daniel Vetter 提交于
      So almost two years ago I've tried to nuke the procfs code already
      once before:
      
      http://lists.freedesktop.org/archives/dri-devel/2011-October/015707.html
      
      The conclusion was that userspace drivers (specifically libdrm device
      node detection) stopped relying on procfs in 2001. But after some
      digging it turned out that the drmstat tool in libdrm is still using
      those files (but only when certain options are set). So we've decided
      to keep profcs.
      
      But I when I've started to dig around again what exactly this tool
      does I've noticed that it tries to read the "mem", "vm", and "vma"
      files from procfs. Now as far my git history digging shows "mem" never
      did anything useful (at least in the version that first showed up in
      upstream history in 2004) and the file was remove in
      
      commit 955b12de
      Author: Ben Gamari <bgamari@gmail.com>
      Date:   Tue Feb 17 20:08:49 2009 -0500
      
          drm: Convert proc files to seq_file and introduce debugfs
      
      Which means that for over 4 years drmstat has been broken, and no one
      cared. In my opinion that's proof enough that no one is actually using
      drmstat, and so that we can savely nuke the procfs support from drm.
      
      While at it fix up the error case cleanup for debugfs in drm_get_minor.
      
      v2: Fix dates, libdrm stopped relying on procfs for drm node detection
      in 2001.
      
      v3: fixup compilation warning for !CONFIG_DEBUG_FS, reported by
      Fengguang Wu.
      
      Cc: kbuild test robot <fengguang.wu@intel.com>
      Cc: Dave Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      cb6458f9
    • D
      drm: don't call ->firstopen for KMS drivers · 7d14bb6b
      Daniel Vetter 提交于
      It has way too much potential for driver writers to do stupid things
      like delayed hw setup because the load sequence is somehow racy (e.g.
      the imx driver in staging). So don't call it for modesetting drivers,
      which reduces the complexity of the drm core -> driver interface a
      notch.
      
      v2: Don't forget to update DocBook.
      
      v3: Go with Laurent's slightly more elaborate proposal for the DocBook
      update. Add a few words on top of his diff to elaborate a bit on what
      KMS drivers should and shouldn't do in lastclose. There was already a
      paragraph present talking about restoring properties, I've simply
      extended that one.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      7d14bb6b
    • D
      drm/vmwgfx: remove ->firstopen callback · 0faa4a87
      Daniel Vetter 提交于
      So if we survey kms drivers there's a bunch of things they commonly do
      in ->lastclose
      - delayed processing of vga switcheroo requests (i915, nouveau,
        radeon)
      - force-restoring the fbcon (most)
      - resetting a bunch properties to make fbcon work better (omap)
      - disabling all outputs (vmwgfx)
      
      In short besides the semantically important vga switcheroo stuff they
      all try very hard to keep fbcon working in case X dies.
      
      But none of them try to not do this at driver unload time safe for
      vmwgfx, and digging through logs I couldn't find any reason for why
      vmwgfx is special.
      
      Since ->firstopen has lots of potential for abuse with kms drivers
      (like delaying driver setup to pamper over races in the load sequence)
      it's imo very much worth it to remove this logic so that we can
      stop using the ->firstopen callback for kms drivers.
      
      Also module unloading is rather a debug feature and developers should
      know how to restore the display to a sane configuration.
      
      Cc: Jakob Bornecrantz <jakob@vmware.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0faa4a87
    • D
      drm/imx: kill firstopen callback · b5dc0d10
      Daniel Vetter 提交于
      This thing seems to do some kind of delayed setup. Really, real kms
      drivers shouldn't do that at all. Either stuff needs to be dynamically
      hotplugged or the driver setup sequence needs to be fixed.
      
      This patch here just moves the setup at the very end of the driver
      load callback, with the locking adjusted accordingly.
      
      v2: Also move the corresponding put from ->lastclose to ->unload.
      
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b5dc0d10
    • K
      drm: fix minor number range calculation · 24f40032
      Kristian Høgsberg 提交于
      Currently, both ranges overlap. Fix the limits so both ranges are mutually
      exclusive. Also use the occasion to convert whitespaces to tabs.
      Signed-off-by: NKristian Høgsberg <krh@bitplanet.net>
      (fixed up tabs and adjust commit-msg accordingly)
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      24f40032
    • D
      drm: fix locking in gem debugfs/procfs file · 90254ac0
      Daniel Vetter 提交于
      The idr is protected with our spinlock, if we don't hold that nothing
      prevents the gem objects from disappearing from under us.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      90254ac0
    • D
      drm: remove the dma_ioctl special-case · 6eb9278a
      Daniel Vetter 提交于
      We might as well have a real ioctl function which checks for the
      callbacks. This seems to be a remnant from back in the days when each
      drm driver had their own complete ioctl table, with no shared core
      drm table at all.
      
      To make really sure no mis-guided user in a kms driver pops up again
      explicitly check for that in the new ioctl implementation.
      
      v2: Drop the unused variable I've accidentally left in the code,
      spotted by David Herrmann.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      6eb9278a
    • D
      drm: rip out drm_core_has_MTRR checks · 28185647
      Daniel Vetter 提交于
      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: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: NAndy Lutomirski <luto@amacapital.net>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      28185647
    • D
      drm/gem: WARN about unbalanced handle refcounts · 1216f732
      Daniel Vetter 提交于
      Trying to drop a reference we don't have is a pretty serious bug.
      Trying to paper over it is an even worse offense.
      
      So scream into dmesg with a big WARN in case that ever happens.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1216f732
    • D
      drm/gem: remove bogus NULL check from drm_gem_object_handle_unreference_unlocked · 6bc505b8
      Daniel Vetter 提交于
      Calling this function with a NULL object is simply a bug, so papering
      over a NULL object not a good idea.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      6bc505b8
    • D
      drm/gem: move drm_gem_object_handle_unreference_unlocked into drm_gem.c · 36da5908
      Daniel Vetter 提交于
      We have three callers of this function now and it's neither
      performance critical nor really small. So an inline function feels
      like overkill and unecessarily separates the different parts of the
      code.
      
      Since all callers of drm_gem_object_handle_free are now in drm_gem.c
      we can make that static (and remove the unused EXPORT_SYMBOL). To
      avoid a forward declaration move it (and drm_gem_object_free_bug) up a
      bit.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      36da5908
    • D
      drm/prime: remove cargo-cult locking from map_sg helper · 01ce605a
      Daniel Vetter 提交于
      I've checked both implementations (radeon/nouveau) and they both grab
      the page array from ttm simply by dereferencing it and then wrapping
      it up with drm_prime_pages_to_sg in the callback and map it with
      dma_map_sg (in the helper).
      
      Only the grabbing of the underlying page array is anything we need to
      be concerned about, and either those pages are pinned independently,
      or we're screwed no matter what.
      
      And indeed, nouveau/radeon pin the backing storage in their
      attach/detach functions.
      
      Since I've created this patch cma prime support for dma_buf was added.
      drm_gem_cma_prime_get_sg_table only calls kzalloc and the creates&maps
      the sg table with dma_get_sgtable. It doesn't touch any gem object
      state otherwise. So the cma helpers also look safe.
      
      The only thing we might claim it does is prevent concurrent mapping of
      dma_buf attachments. But a) that's not allowed and b) the current code
      is racy already since it checks whether the sg mapping exists _before_
      grabbing the lock.
      
      So the dev->struct_mutex locking here does absolutely nothing useful,
      but only distracts. Remove it.
      
      This should also help Maarten's work to eventually pin the backing
      storage more dynamically by preventing locking inversions around
      dev->struct_mutex.
      
      v2: Add analysis for recently added cma helper prime code.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      01ce605a
    • I
    • D
      drm: use common drm_gem_dmabuf_release in i915/exynos drivers · c1d6798d
      Daniel Vetter 提交于
      Note that this is slightly tricky since both drivers store their
      native objects in dma_buf->priv. But both also embed the base
      drm_gem_object at the first position, so the implicit cast is ok.
      
      To use the release helper we need to export it, too.
      
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c1d6798d
    • D
      drm/host1x: stop casting VMA offsets to 32bit · 2bc7b0ca
      David Herrmann 提交于
      VMA offsets are 64bit so do not cast them to "unsigned int". Also remove
      the (now useless) offset-retrieval helper. The VMA manager provides simple
      enough helpers.
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: "Terje Bergström" <tbergstrom@nvidia.com>
      Cc: Arto Merilainen <amerilainen@nvidia.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2bc7b0ca
    • I
      drm: use ida to allocate connector ids · b21e3afe
      Ilia Mirkin 提交于
      This makes it so that reloading a module does not cause all the
      connector ids to change, which are user-visible and sometimes used
      for configuration.
      Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b21e3afe
    • R
      drm/omap: kill omap_gem_helpers.c · ddcd09d6
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ddcd09d6
    • R
      drm/udl: use gem get/put page helpers · 5dc9e1e8
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5dc9e1e8
    • R
      drm/gma500: use gem get/put page helpers · 8b9ba7a3
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8b9ba7a3
    • R
      drm/gem: add shmem get/put page helpers · bcc5c9d5
      Rob Clark 提交于
      Basically just extracting some code duplicated in gma500, omapdrm, udl,
      and upcoming msm driver.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      bcc5c9d5
    • R
      drm/gem: add drm_gem_create_mmap_offset_size() · 367bbd49
      Rob Clark 提交于
      Variant of drm_gem_create_mmap_offset() which doesn't make the
      assumption that virtual size and physical size (obj->size) are the same.
      This is needed in omapdrm to deal with tiled buffers.  And lets us get
      rid of a duplicated and slightly modified version of
      drm_gem_create_mmap_offset() in omapdrm.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      367bbd49
    • R
      drm/omap: use flip-work helper · 5833bd2f
      Rob Clark 提交于
      And simplify how we hold a ref+pin to what is being scanned out by using
      fb refcnt'ing.  The previous logic pre-dated fb refcnt, and as a result
      was less straightforward than it could have been.  By holding a ref to
      the fb, we don't have to care about how many plane's there are and
      holding a ref to each color plane's bo.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5833bd2f
    • R
      drm/tilcdc: use flip-work helper · a464d618
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Tested-by: NDarren Etheridge <detheridge@ti.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a464d618
    • R
      drm: add flip-work helper · cabaafc7
      Rob Clark 提交于
      A small helper to queue up work to do, from workqueue context, after a
      flip.  Typically useful to defer unreffing buffers that may be read by
      the display controller until vblank.
      
      v1: original
      v2: wire up docbook + couple docbook fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      cabaafc7
    • S
      drm: Remove drm_mode_validate_clocks · b17df86e
      Stéphane Marchesin 提交于
      This function is unused.
      Signed-off-by: NStéphane Marchesin <marcheu@chromium.org>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b17df86e
    • 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/memory: don't export agp helpers · d678959f
      Daniel Vetter 提交于
      They're only used by the agpgart support code in drm_agpgart.c,
      not by any drivers.
      
      I think long-term we should create a drm_internal.h include file with
      all the various functions only used by the drm core and not exported
      to drivers, and remove them from drmP.h. Oh, and someone should kill
      that upper-case P sometimes ;-) But that's all stuff for future patch
      bombs.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d678959f
    • D
      drm: rip out a few unused DRIVER flags · 74867e3d
      Daniel Vetter 提交于
      The gma500 driver somehow set the DRIVER_IRQ_VBL flag, but since
      there's no code at all to check for this we can kill it. The other two
      are completely unused.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      74867e3d
    • D
      drm: rip out DRIVER_FB_DMA and related code · 687fbb2e
      Daniel Vetter 提交于
      No driver ever sets that flag, so good riddance!
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      687fbb2e
    • D
      drm: remove FASYNC support · b0e898ac
      Daniel Vetter 提交于
      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: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b0e898ac
    • D
      drm/vmwgfx: remove redundant clearing of driver->dma_quiescent · 5bbd5332
      Daniel Vetter 提交于
      It's kzalloced ...
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5bbd5332
    • D
      drm: mark context support as a legacy subsystem · 7c510133
      Daniel Vetter 提交于
      So after a lot of digging around in git histories it looks like this
      has only ever be used by dri1 render clients. Hence we can fully
      disable the entire thing for modesetting drivers and so greatly reduce
      the attack surface for potential exploits (or at least tools like
      trinity ...).
      
      Also add the drm_legacy prefix for functions which are called from
      common code. To further reduce the impact on common code also extract
      all the ctx release handling into a function (instead of only
      releasing individual handles) and make ctxbitmap_cleanup return void -
      it can never fail.
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      7c510133