Skip to content

Commit

Permalink
drm/i915: Skip allocating shadow batch for 0-length batches
Browse files Browse the repository at this point in the history
Since

commit 17cabf5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jan 14 11:20:57 2015 +0000

    drm/i915: Trim the command parser allocations

we may then try to allocate a zero-sized object and attempt to extract
its pages. Understandably this fails.

Testcase: igt/gem_exec_nop #ivb,byt,hsw
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Mar 27, 2015
1 parent 9d918c1 commit 743e78c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
goto err;
}

if (i915_needs_cmd_parser(ring)) {
if (i915_needs_cmd_parser(ring) && args->batch_len) {
batch_obj = i915_gem_execbuffer_parse(ring,
&shadow_exec_entry,
eb,
Expand Down

0 comments on commit 743e78c

Please sign in to comment.