OSDN Git Service

drm/i915/gem: Unify user object creation (v3)
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 23 Jul 2021 17:21:38 +0000 (12:21 -0500)
committerMatthew Auld <matthew.auld@intel.com>
Mon, 26 Jul 2021 15:37:33 +0000 (16:37 +0100)
commitbf947c989c1642d89062a03121f30760dca10c06
tree94d788e6a8e5001e97d96386953ba0fa5d9f1e7e
parent82ec88e11d46e3d981e2db854fa5ab037c2c0f1f
drm/i915/gem: Unify user object creation (v3)

Instead of hand-rolling the same three calls in each function, pull them
into an i915_gem_object_create_user helper.  Apart from re-ordering of
the placements array ENOMEM check, there should be no functional change.

v2 (Matthew Auld):
 - Add the call to i915_gem_flush_free_objects() from
   i915_gem_dumb_create() in a separate patch
 - Move i915_gem_object_alloc() below the simple error checks
v3 (Matthew Auld):
 - Add __ to i915_gem_object_create_user and kerneldoc which warns the
   caller that it's not validating anything.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210723172142.3273510-5-jason@jlekstrand.net
drivers/gpu/drm/i915/gem/i915_gem_create.c
drivers/gpu/drm/i915/gem/i915_gem_object.h