drm/i915: Drop i915_request.i915 backpointer
We infrequently use the direct i915 backpointer from the i915_request, so do we really need to waste the space in the struct for it? 8 bytes from the most frequently allocated struct vs an 3 bytes and pointer chasing in using rq->engine->i915? Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200602220953.21178-1-chris@chris-wilson.co.uk
This commit is contained in:
@@ -56,7 +56,7 @@ static struct i915_global_request {
|
||||
|
||||
static const char *i915_fence_get_driver_name(struct dma_fence *fence)
|
||||
{
|
||||
return dev_name(to_request(fence)->i915->drm.dev);
|
||||
return dev_name(to_request(fence)->engine->i915->drm.dev);
|
||||
}
|
||||
|
||||
static const char *i915_fence_get_timeline_name(struct dma_fence *fence)
|
||||
@@ -812,7 +812,6 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
|
||||
}
|
||||
}
|
||||
|
||||
rq->i915 = ce->engine->i915;
|
||||
rq->context = ce;
|
||||
rq->engine = ce->engine;
|
||||
rq->ring = ce->ring;
|
||||
@@ -1011,12 +1010,12 @@ __emit_semaphore_wait(struct i915_request *to,
|
||||
struct i915_request *from,
|
||||
u32 seqno)
|
||||
{
|
||||
const int has_token = INTEL_GEN(to->i915) >= 12;
|
||||
const int has_token = INTEL_GEN(to->engine->i915) >= 12;
|
||||
u32 hwsp_offset;
|
||||
int len, err;
|
||||
u32 *cs;
|
||||
|
||||
GEM_BUG_ON(INTEL_GEN(to->i915) < 8);
|
||||
GEM_BUG_ON(INTEL_GEN(to->engine->i915) < 8);
|
||||
GEM_BUG_ON(i915_request_has_initial_breadcrumb(to));
|
||||
|
||||
/* We need to pin the signaler's HWSP until we are finished reading. */
|
||||
@@ -1211,7 +1210,7 @@ __i915_request_await_external(struct i915_request *rq, struct dma_fence *fence)
|
||||
{
|
||||
mark_external(rq);
|
||||
return i915_sw_fence_await_dma_fence(&rq->submit, fence,
|
||||
i915_fence_context_timeout(rq->i915,
|
||||
i915_fence_context_timeout(rq->engine->i915,
|
||||
fence->context),
|
||||
I915_FENCE_GFP);
|
||||
}
|
||||
@@ -1782,7 +1781,8 @@ long i915_request_wait(struct i915_request *rq,
|
||||
* (bad for battery).
|
||||
*/
|
||||
if (flags & I915_WAIT_PRIORITY) {
|
||||
if (!i915_request_started(rq) && INTEL_GEN(rq->i915) >= 6)
|
||||
if (!i915_request_started(rq) &&
|
||||
INTEL_GEN(rq->engine->i915) >= 6)
|
||||
intel_rps_boost(rq);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user