]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: refactor eb_get_batch()
authorDave Gordon <david.s.gordon@intel.com>
Thu, 14 Jul 2016 13:52:04 +0000 (14:52 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 19 Jul 2016 07:06:32 +0000 (09:06 +0200)
commit268819f69633b84cc9483afe40eb27dca3ba5135
tree9fcb38ea445106706d16ef73af1c6e472cd95db0
parent176c742d62d7759735b6901d484f69aab913181f
drm/i915: refactor eb_get_batch()

Precursor for fix to secure batch execution. We will need to be able to
retrieve the batch VMA (as well as the batch itself) from the eb list,
so this patch extracts that part of eb_get_batch() into a separate
function, and moves both parts to a more logical place in the file, near
where the eb list is created.

Also, it may not be obvious, but the current execbuffer2 ioctl interface
requires that the buffer object containing the batch-to-be-executed be
the LAST entry in the exec2_list[] array (I expected it to be the
first!).

To clarify this, we can replace the rather obscure construct
"list_entry(eb->vmas.prev, ...)"
in the old version of eb_get_batch() with the equivalent but more
explicit
"list_last_entry(&eb->vmas,...)"
in the new eb_get_batch_vma() and of course add an explanatory comment.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1468504324-12690-2-git-send-email-david.s.gordon@intel.com
drivers/gpu/drm/i915/i915_gem_execbuffer.c