aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_execbuffer.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2018-12-12 13:10:43 -0500
committerRodrigo Vivi <rodrigo.vivi@intel.com>2018-12-12 19:52:10 -0500
commitcf819eff907ab49205ece97c96baeb909fd36f4d (patch)
treea72b69e1d0c1a188db876edccafcf04612133132 /drivers/gpu/drm/i915/i915_gem_execbuffer.c
parent006900087727f675e9367eb3c3e054912ddbffdd (diff)
drm/i915: replace IS_GEN<N> with IS_GEN(..., N)
Define IS_GEN() similarly to our IS_GEN_RANGE(). but use gen instead of gen_mask to do the comparison. Now callers can pass then gen as a parameter, so we don't require one macro for each gen. The following spatch was used to convert the users of these macros: @@ expression e; @@ ( - IS_GEN2(e) + IS_GEN(e, 2) | - IS_GEN3(e) + IS_GEN(e, 3) | - IS_GEN4(e) + IS_GEN(e, 4) | - IS_GEN5(e) + IS_GEN(e, 5) | - IS_GEN6(e) + IS_GEN(e, 6) | - IS_GEN7(e) + IS_GEN(e, 7) | - IS_GEN8(e) + IS_GEN(e, 8) | - IS_GEN9(e) + IS_GEN(e, 9) | - IS_GEN10(e) + IS_GEN(e, 10) | - IS_GEN11(e) + IS_GEN(e, 11) ) v2: use IS_GEN rather than GT_GEN and compare to info.gen rather than using the bitmask Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181212181044.15886-2-lucas.demarchi@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 1a1c04db6c80..844bd5ad87bc 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1380,7 +1380,7 @@ eb_relocate_entry(struct i915_execbuffer *eb,
1380 * batchbuffers. 1380 * batchbuffers.
1381 */ 1381 */
1382 if (reloc->write_domain == I915_GEM_DOMAIN_INSTRUCTION && 1382 if (reloc->write_domain == I915_GEM_DOMAIN_INSTRUCTION &&
1383 IS_GEN6(eb->i915)) { 1383 IS_GEN(eb->i915, 6)) {
1384 err = i915_vma_bind(target, target->obj->cache_level, 1384 err = i915_vma_bind(target, target->obj->cache_level,
1385 PIN_GLOBAL); 1385 PIN_GLOBAL);
1386 if (WARN_ONCE(err, 1386 if (WARN_ONCE(err,
@@ -1893,7 +1893,7 @@ static int i915_reset_gen7_sol_offsets(struct i915_request *rq)
1893 u32 *cs; 1893 u32 *cs;
1894 int i; 1894 int i;
1895 1895
1896 if (!IS_GEN7(rq->i915) || rq->engine->id != RCS) { 1896 if (!IS_GEN(rq->i915, 7) || rq->engine->id != RCS) {
1897 DRM_DEBUG("sol reset is gen7/rcs only\n"); 1897 DRM_DEBUG("sol reset is gen7/rcs only\n");
1898 return -EINVAL; 1898 return -EINVAL;
1899 } 1899 }