mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
drm/i915: Nuke arguments to eb_pin_engine
Those arguments are already set as eb.file and eb.args, so kill off the extra arguments. This will allow us to move eb_pin_engine() to after we reserved all BO's. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200819140904.1708856-12-maarten.lankhorst@linux.intel.com Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
This commit is contained in:
parent
99f08d674e
commit
b49a7d51c3
1 changed files with 7 additions and 10 deletions
|
@ -2610,11 +2610,10 @@ static void eb_unpin_engine(struct i915_execbuffer *eb)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
eb_select_legacy_ring(struct i915_execbuffer *eb,
|
eb_select_legacy_ring(struct i915_execbuffer *eb)
|
||||||
struct drm_file *file,
|
|
||||||
struct drm_i915_gem_execbuffer2 *args)
|
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = eb->i915;
|
struct drm_i915_private *i915 = eb->i915;
|
||||||
|
struct drm_i915_gem_execbuffer2 *args = eb->args;
|
||||||
unsigned int user_ring_id = args->flags & I915_EXEC_RING_MASK;
|
unsigned int user_ring_id = args->flags & I915_EXEC_RING_MASK;
|
||||||
|
|
||||||
if (user_ring_id != I915_EXEC_BSD &&
|
if (user_ring_id != I915_EXEC_BSD &&
|
||||||
|
@ -2629,7 +2628,7 @@ eb_select_legacy_ring(struct i915_execbuffer *eb,
|
||||||
unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
|
unsigned int bsd_idx = args->flags & I915_EXEC_BSD_MASK;
|
||||||
|
|
||||||
if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
|
if (bsd_idx == I915_EXEC_BSD_DEFAULT) {
|
||||||
bsd_idx = gen8_dispatch_bsd_engine(i915, file);
|
bsd_idx = gen8_dispatch_bsd_engine(i915, eb->file);
|
||||||
} else if (bsd_idx >= I915_EXEC_BSD_RING1 &&
|
} else if (bsd_idx >= I915_EXEC_BSD_RING1 &&
|
||||||
bsd_idx <= I915_EXEC_BSD_RING2) {
|
bsd_idx <= I915_EXEC_BSD_RING2) {
|
||||||
bsd_idx >>= I915_EXEC_BSD_SHIFT;
|
bsd_idx >>= I915_EXEC_BSD_SHIFT;
|
||||||
|
@ -2654,18 +2653,16 @@ eb_select_legacy_ring(struct i915_execbuffer *eb,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
eb_pin_engine(struct i915_execbuffer *eb,
|
eb_pin_engine(struct i915_execbuffer *eb)
|
||||||
struct drm_file *file,
|
|
||||||
struct drm_i915_gem_execbuffer2 *args)
|
|
||||||
{
|
{
|
||||||
struct intel_context *ce;
|
struct intel_context *ce;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (i915_gem_context_user_engines(eb->gem_context))
|
if (i915_gem_context_user_engines(eb->gem_context))
|
||||||
idx = args->flags & I915_EXEC_RING_MASK;
|
idx = eb->args->flags & I915_EXEC_RING_MASK;
|
||||||
else
|
else
|
||||||
idx = eb_select_legacy_ring(eb, file, args);
|
idx = eb_select_legacy_ring(eb);
|
||||||
|
|
||||||
ce = i915_gem_context_get_engine(eb->gem_context, idx);
|
ce = i915_gem_context_get_engine(eb->gem_context, idx);
|
||||||
if (IS_ERR(ce))
|
if (IS_ERR(ce))
|
||||||
|
@ -3125,7 +3122,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
|
||||||
if (unlikely(err))
|
if (unlikely(err))
|
||||||
goto err_destroy;
|
goto err_destroy;
|
||||||
|
|
||||||
err = eb_pin_engine(&eb, file, args);
|
err = eb_pin_engine(&eb);
|
||||||
if (unlikely(err))
|
if (unlikely(err))
|
||||||
goto err_context;
|
goto err_context;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue