Commit a6d09186 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Stuff rotation params into view union

We don't need 2 separate unions.

Note that this was done intentinoally

Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Date:   Wed May 6 14:35:38 2015 +0300

    drm/i915: Add a partial GGTT view type

on Tvrtko's request, but without a clear justification. Rotated views
are also not checking for matching paramters in i915_ggtt_view_equal,
which seems like a bug. But this patch here doesn't change that.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1444834266-12689-2-git-send-email-daniel.vetter@ffwll.chReviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 75c82a53
...@@ -3328,7 +3328,7 @@ static struct sg_table * ...@@ -3328,7 +3328,7 @@ static struct sg_table *
intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj)
{ {
struct intel_rotation_info *rot_info = &ggtt_view->rotation_info; struct intel_rotation_info *rot_info = &ggtt_view->params.rotation_info;
unsigned int size_pages = rot_info->size >> PAGE_SHIFT; unsigned int size_pages = rot_info->size >> PAGE_SHIFT;
unsigned int size_pages_uv; unsigned int size_pages_uv;
struct sg_page_iter sg_iter; struct sg_page_iter sg_iter;
...@@ -3560,7 +3560,7 @@ i915_ggtt_view_size(struct drm_i915_gem_object *obj, ...@@ -3560,7 +3560,7 @@ i915_ggtt_view_size(struct drm_i915_gem_object *obj,
if (view->type == I915_GGTT_VIEW_NORMAL) { if (view->type == I915_GGTT_VIEW_NORMAL) {
return obj->base.size; return obj->base.size;
} else if (view->type == I915_GGTT_VIEW_ROTATED) { } else if (view->type == I915_GGTT_VIEW_ROTATED) {
return view->rotation_info.size; return view->params.rotation_info.size;
} else if (view->type == I915_GGTT_VIEW_PARTIAL) { } else if (view->type == I915_GGTT_VIEW_PARTIAL) {
return view->params.partial.size << PAGE_SHIFT; return view->params.partial.size << PAGE_SHIFT;
} else { } else {
......
...@@ -156,13 +156,10 @@ struct i915_ggtt_view { ...@@ -156,13 +156,10 @@ struct i915_ggtt_view {
u64 offset; u64 offset;
unsigned int size; unsigned int size;
} partial; } partial;
struct intel_rotation_info rotation_info;
} params; } params;
struct sg_table *pages; struct sg_table *pages;
union {
struct intel_rotation_info rotation_info;
};
}; };
extern const struct i915_ggtt_view i915_ggtt_view_normal; extern const struct i915_ggtt_view i915_ggtt_view_normal;
......
...@@ -2265,7 +2265,7 @@ static void ...@@ -2265,7 +2265,7 @@ static void
intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb, intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb,
const struct drm_plane_state *plane_state) const struct drm_plane_state *plane_state)
{ {
struct intel_rotation_info *info = &view->rotation_info; struct intel_rotation_info *info = &view->params.rotation_info;
unsigned int tile_height, tile_pitch; unsigned int tile_height, tile_pitch;
*view = i915_ggtt_view_normal; *view = i915_ggtt_view_normal;
...@@ -2929,7 +2929,7 @@ u32 intel_plane_obj_offset(struct intel_plane *intel_plane, ...@@ -2929,7 +2929,7 @@ u32 intel_plane_obj_offset(struct intel_plane *intel_plane,
offset = vma->node.start; offset = vma->node.start;
if (plane == 1) { if (plane == 1) {
offset += vma->ggtt_view.rotation_info.uv_start_page * offset += vma->ggtt_view.params.rotation_info.uv_start_page *
PAGE_SIZE; PAGE_SIZE;
} }
......
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