summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2015-03-27 13:09:22 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-27 15:05:22 +0100
commit9abc464854cf12273ebe66dc5e4a9d82b6e0c303 (patch)
tree0144e08f04e21fb2cd26c8711afb7d628b2c6518 /drivers/gpu/drm/i915/intel_display.c
parent2f2cf68261acc4c5356dd07e8a8966612ae5a0d4 (diff)
drm/i915: Compare GGTT view structs instead of types
To allow for views where the view type is not defined by the view type only, like it is in stereo or rotated 90 degree view, change the semantic to require the whole view structure for comparison when we match a GGTT view. This allows including parameters like offset to be included in the view which is useful for eg. partial views. v3: - Rely on ggtt_view type being 0 for non-GGTT vma's, which equals to I915_GGTT_VIEW_NORMAL. (Daniel Vetter) - Do not use potentially slower comparison when we only want to know if something is or is not a normal view. - Rebase on top of rotated view patches. Add rotated view singleton. - If one view is missing in comparison they're equal only if both are missing. v4: - Use comparison helper in obj_to_ggtt_view too. (Tvrtko Ursulin) - Do WARN_ON if one view is NULL. (Tvrtko Ursulin) Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dc9a5c1d596c..3852cbaf9163 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2322,8 +2322,6 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb,
const struct drm_plane_state *plane_state)
{
struct intel_rotation_info *info = &view->rotation_info;
- static const struct i915_ggtt_view rotated_view =
- { .type = I915_GGTT_VIEW_ROTATED };
*view = i915_ggtt_view_normal;
@@ -2333,7 +2331,7 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb,
if (!intel_rotation_90_or_270(plane_state->rotation))
return 0;
- *view = rotated_view;
+ *view = i915_ggtt_view_rotated;
info->height = fb->height;
info->pixel_format = fb->pixel_format;
@@ -2930,10 +2928,10 @@ u32 intel_fb_stride_alignment(struct drm_device *dev, uint64_t fb_modifier,
unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane,
struct drm_i915_gem_object *obj)
{
- enum i915_ggtt_view_type view = I915_GGTT_VIEW_NORMAL;
+ const struct i915_ggtt_view *view = &i915_ggtt_view_normal;
if (intel_rotation_90_or_270(intel_plane->base.state->rotation))
- view = I915_GGTT_VIEW_ROTATED;
+ view = &i915_ggtt_view_rotated;
return i915_gem_obj_ggtt_offset_view(obj, view);
}