]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Convert i915_ggtt_view to use an anonymous union
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 14 Jan 2017 00:28:25 +0000 (00:28 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 14 Jan 2017 16:18:03 +0000 (16:18 +0000)
commit7c6cc6899ee5cd7c49b0733e04f86907b7f10f80
tree27b974b6cabc59cff6581a5e19ca8e65e987be66
parent935ba4884cd2b0eb7e86bb9bdb3a2417e196dd88
drm/i915: Convert i915_ggtt_view to use an anonymous union

Reading the ggtt_views is much more pleasant without the extra
characters from specifying the union (i.e. ggtt_view.partial rather than
ggtt_view.params.partial). To make this work inside i915_vma_compare()
with only a single memcmp requires us to ensure that there are no
uninitialised bytes within each branch of the union (we make sure the
structs are packed) and we need to store the size of each branch.

v4: Rewrite changelog and add comments explaining the assert.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170114002827.31315-5-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_gtt.h
drivers/gpu/drm/i915/i915_vma.c
drivers/gpu/drm/i915/i915_vma.h
drivers/gpu/drm/i915/intel_display.c