1. 23 4月, 2014 3 次提交
  2. 22 4月, 2014 1 次提交
  3. 16 3月, 2014 1 次提交
    • D
      drm: provide device-refcount · 099d1c29
      David Herrmann 提交于
      Lets not trick ourselves into thinking "drm_device" objects are not
      ref-counted. That's just utterly stupid. We manage "drm_minor" objects on
      each drm-device and each minor can have an unlimited number of open
      handles. Each of these handles has the drm_minor (and thus the drm_device)
      as private-data in the file-handle. Therefore, we may not destroy
      "drm_device" until all these handles are closed.
      
      It is *not* possible to reset all these pointers atomically and restrict
      access to them, and this is *not* how this is done! Instead, we use
      ref-counts to make sure the object is valid and not freed.
      
      Note that we currently use "dev->open_count" for that, which is *exactly*
      the same as a reference-count, just open coded. So this patch doesn't
      change any semantics on DRM devices (well, this patch just introduces the
      ref-count, anyway. Follow-up patches will replace open_count by it).
      
      Also note that generic VFS revoke support could allow us to drop this
      ref-count again. We could then just synchronously disable any fops->xy()
      calls. However, this is not the case, yet, and no such patches are
      in sight (and I seriously question the idea of dropping the ref-cnt
      again).
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      099d1c29
  4. 14 1月, 2014 1 次提交
  5. 18 12月, 2013 1 次提交
    • D
      drm: restrict the device list for shadow attached drivers · b3f2333d
      Daniel Vetter 提交于
      There's really no need for the drm core to keep a list of all
      devices of a given driver - the linux device model keeps perfect
      track of this already for us.
      
      The exception is old legacy ums drivers using pci shadow attaching.
      So rename the lists to make the use case clearer and rip out everything
      else.
      
      v2: Rebase on top of David Herrmann's drm device register changes.
      Also drop the bogus dev_set_drvdata for platform drivers that somehow
      crept into the original version - drivers really should be in full
      control of that field.
      
      v3: Initialize driver->legacy_dev_list outside of the loop, spotted by
      David Herrmann.
      
      v4: Rebase on top of the newly created host1x drm_bus for tegra.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b3f2333d
  6. 09 10月, 2013 3 次提交
    • D
      drm: introduce drm_dev_free() to fix error paths · 0dc8fe59
      David Herrmann 提交于
      The error paths in DRM bus drivers currently leak memory as they don't
      correctly revert drm_dev_alloc(). Introduce drm_dev_free() to free DRM
      devices which haven't been registered, yet.
      
      We must be careful not to introduce any side-effects with cleanups done in
      drm_dev_free(). drm_ht_remove(), drm_ctxbitmap_cleanup() and
      drm_gem_destroy() are all fine in that regard.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0dc8fe59
    • D
      drm: merge device setup into drm_dev_register() · c22f0ace
      David Herrmann 提交于
      All bus drivers do device setup themselves. This requires us to adjust all
      of them if we introduce new core features. Thus, merge all these into a
      uniform drm_dev_register() helper.
      
      Note that this removes the drm_lastclose() error path for AGP as it is
      horribly broken. Moreover, no bus driver called this in any other error
      path either. Instead, we use the recently introduced AGP cleanup helpers.
      
      We also keep a DRIVER_MODESET condition around pci_set_drvdata() to keep
      semantics.
      
      [airlied: keep passing flags through so drivers don't oops on load]
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c22f0ace
    • D
      drm: add drm_dev_alloc() helper · 1bb72532
      David Herrmann 提交于
      Instead of managing device allocation+initialization in each bus-driver,
      we should do that in a central place. drm_fill_in_dev() already does most
      of it, but also requires the global drm lock for partial AGP device
      registration.
      
      Split both apart so we have a clean device initialization/allocation
      phase, and a registration phase.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1bb72532
  7. 30 8月, 2013 1 次提交
    • D
      drm: implement experimental render nodes · 1793126f
      David Herrmann 提交于
      Render nodes provide an API for userspace to use non-privileged GPU
      commands without any running DRM-Master. It is useful for offscreen
      rendering, GPGPU clients, and normal render clients which do not perform
      modesetting.
      
      Compared to legacy clients, render clients no longer need any
      authentication to perform client ioctls. Instead, user-space controls
      render/client access to GPUs via filesystem access-modes on the
      render-node. Once a render-node was opened, a client has full access to
      the client/render operations on the GPU. However, no modesetting or ioctls
      that affect global state are allowed on render nodes.
      
      To prevent privilege-escalation, drivers must explicitly state that they
      support render nodes. They must mark their render-only ioctls as
      DRM_RENDER_ALLOW so render clients can use them. Furthermore, they must
      support clients without any attached master.
      
      If filesystem access-modes are not enough for fine-grained access control
      to render nodes (very unlikely, considering the versaitlity of FS-ACLs),
      you may still fall-back to fd-passing from server to client (which allows
      arbitrary access-control). However, note that revoking access is
      currently impossible and unlikely to get implemented.
      
      Note: Render clients no longer have any associated DRM-Master as they are
      supposed to be independent of any server state. DRM core highly depends on
      file_priv->master to be non-NULL for modesetting/ctx/etc. commands.
      Therefore, drivers must be very careful to not require DRM-Master if they
      support DRIVER_RENDER.
      
      So far render-nodes are protected by "drm_rnodes". As long as this
      module-parameter is not set to 1, a driver will not create render nodes.
      This allows us to experiment with the API a bit before we stabilize it.
      
      v2: drop insecure GEM_FLINK to force use of dmabuf
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1793126f
  8. 07 2月, 2013 1 次提交
    • D
      drm/usb: bind driver to correct device · 9f23de52
      Dave Airlie 提交于
      While looking at plymouth on udl I noticed that plymouth was trying
      to use its fb plugin not its drm one, it was trying to drmOpen a driver called
      usb not udl, noticed that we actually had out driver pointing at the wrong
      device.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      9f23de52
  9. 03 10月, 2012 1 次提交
  10. 19 4月, 2012 1 次提交
  11. 16 3月, 2012 1 次提交
  12. 01 11月, 2011 1 次提交
  13. 07 2月, 2011 1 次提交