Commit 8d9046ad authored by Chris Wilson's avatar Chris Wilson

drm/i915: Mark the ggtt_view structs as packed

In the next few patches, we will depend upon there being no
uninitialised bits inside the ggtt_view. To ensure this we add the
__packed attribute and double check with a build bug that gcc hasn't
expanded the struct to include some padding bytes.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170114002827.31315-2-chris@chris-wilson.co.uk
parent 7ff19c56
...@@ -156,12 +156,22 @@ struct intel_rotation_info { ...@@ -156,12 +156,22 @@ struct intel_rotation_info {
/* tiles */ /* tiles */
unsigned int width, height, stride, offset; unsigned int width, height, stride, offset;
} plane[2]; } plane[2];
}; } __packed;
static inline void assert_intel_rotation_info_is_packed(void)
{
BUILD_BUG_ON(sizeof(struct intel_rotation_info) != 8*sizeof(unsigned int));
}
struct intel_partial_info { struct intel_partial_info {
u64 offset; u64 offset;
unsigned int size; unsigned int size;
}; } __packed;
static inline void assert_intel_partial_info_is_packed(void)
{
BUILD_BUG_ON(sizeof(struct intel_partial_info) != sizeof(u64) + sizeof(unsigned int));
}
struct i915_ggtt_view { struct i915_ggtt_view {
enum i915_ggtt_view_type type; enum i915_ggtt_view_type type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment