Skip to content

Commit

Permalink
render-state-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ickle committed Nov 17, 2014
1 parent 0a517b6 commit dba076d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpu/drm/i915/i915_gem_render_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct render_state {
struct drm_i915_gem_object *obj;
u64 ggtt_offset;
int gen;
unsigned batch_length;
};

static const struct intel_renderstate_rodata *
Expand Down Expand Up @@ -95,9 +96,13 @@ static int render_state_setup(struct render_state *so)
page = sg_page(so->obj->pages->sgl);
d = kmap(page);

so->batch_length = 0;
while (i < rodata->batch_items) {
u32 s = rodata->batch[i];

if (so->batch_length == 0 && s == MI_BATCH_BUFFER_END)
so->batch_length = sizeof(u32) * ALIGN(i, 2);

if (i * 4 == rodata->reloc[reloc_index]) {
u64 r = s + so->ggtt_offset;
s = lower_32_bits(r);
Expand Down Expand Up @@ -155,7 +160,7 @@ int i915_gem_render_state_init(struct i915_gem_request *rq)

ret = i915_request_emit_batchbuffer(rq, NULL,
so.ggtt_offset,
so.rodata->batch_items * 4,
so.batch_length,
I915_DISPATCH_SECURE);
if (ret)
goto out;
Expand Down

0 comments on commit dba076d

Please sign in to comment.