NV12 90/270 rotated GGTT mapping
Subsystems (2)
cover NV12 90/270 rotated GGTT mapping
From: Tvrtko Ursulin <[email protected]>
First attempt at rotated GGTT mapping for the NV12 format.
It compiles and even does not crash on first use. But some parts are probably too simplistic at the moment and need further polish.
Sending out early since Chandra needs this to complete his display programming patches.
Depends on Chandra's NV12 patch series.
Tvrtko Ursulin (8):
drm/i915: Remove duplicated intel_tile_height declaration drm/i915: Support planar formats in tile height calculations drm/i915: Remove pointless calculation in intel_rotate_fb_obj_pages drm/i915: Extract tiled geometry calculation into a helper function drm/i915: Support appending to the rotated pages mapping drm/i915: Support NV12 in rotated GGTT mapping
drm/i915: Enable querying offset of UV plane with
intel_plane_obj_offset
drm/i915: Allow NV12 with 90/270 rotation
drivers/gpu/drm/i915/i915_gem_gtt.c | 96 +++++++++++++++++++++++-------- drivers/gpu/drm/i915/i915_gem_gtt.h | 3 + drivers/gpu/drm/i915/intel_atomic_plane.c | 3 +- drivers/gpu/drm/i915/intel_display.c | 36 +++++++++--- drivers/gpu/drm/i915/intel_drv.h | 8 +-- drivers/gpu/drm/i915/intel_sprite.c | 4 +- 6 files changed, 109 insertions(+), 41 deletions(-)
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/8 drm/i915: Remove duplicated intel_tile_height declaration
From: Tvrtko Ursulin <[email protected]>
--- drivers/gpu/drm/i915/intel_drv.h | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +0 -3
@@ -1066,9 +1066,6 @@ intel_rotation_90_or_270(unsigned int rotation)return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); } -unsigned int -intel_tile_height (struct drm_device *dev,uint32_t bits_per_pixel, -uint64_t fb_modifier);void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane);
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH 1/8] drm/i915: Remove duplicated intel_tile_height declaration
Quoted 3 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
Signed-off-by Tvrtko Ursulin <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 25 lines
--- drivers/gpu/drm/i915/intel_drv.h | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/i915/intel_drv.h +0
-3@@ -1066,9 +1066,6 @@ intel_rotation_90_or_270(unsigned int rotation)return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); } -unsigned int -intel_tile_height (struct drm_device *dev,uint32_t bits_per_pixel, -uint64_t fb_modifier);void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane);Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/8 drm/i915: Support planar formats in tile height calculations
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
This will be needed for NV12 support.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 8 ++++---- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_sprite.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -1
@@ -2699,7 +2699,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,/* Calculate tiling geometry. */ tile_height =intel_tile_height (dev, rot_info->pixel_format, - rot_info->fb_modifier); + rot_info->fb_modifier,0 ); tile_pitch =PAGE_SIZE / tile_height; width_pages =DIV_ROUND_UP (rot_info->pitch, tile_pitch); height_pages =DIV_ROUND_UP (rot_info->height, tile_height);
drivers/gpu/drm/i915/intel_display.c +4 -4
@@ -2273,7 +2273,7 @@ static bool need_vtd_wa(struct drm_device *dev)unsigned int intel_tile_height (struct drm_device *dev,uint32_t pixel_format, -uint64_t fb_format_modifier) +uint64_t fb_format_modifier,unsigned int plane) {unsigned int tile_height;uint32_t pixel_bytes;
@@ -2289,7 +2289,7 @@ intel_tile_height(struct drm_device *dev, uint32_t pixel_format, tile_height =32 ;break ;case I915_FORMAT_MOD_Yf_TILED: - pixel_bytes =drm_format_plane_cpp (pixel_format,0 ); + pixel_bytes =drm_format_plane_cpp (pixel_format, plane);switch (pixel_bytes) {default :case 1 :
@@ -2323,7 +2323,7 @@ intel_fb_align_height(struct drm_device *dev, unsigned int height, uint32_t pixel_format, uint64_t fb_format_modifier) {return ALIGN (height,intel_tile_height (dev, pixel_format, - fb_format_modifier)); + fb_format_modifier,0 )); } static int
@@ -3141,7 +3141,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,if (intel_rotation_90_or_270 (rotation)) {/* stride = Surface height in tiles */ tile_height =intel_tile_height (dev, fb->bits_per_pixel, - fb->modifier[0 ]); + fb->modifier[0 ],0 ); stride =DIV_ROUND_UP (fb->height, tile_height); x_offset = stride * tile_height - y - src_h; y_offset = x;
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -1058,7 +1058,7 @@ int intel_plane_atomic_set_property(struct drm_plane *plane,unsigned int intel_tile_height (struct drm_device *dev,uint32_t pixel_format, -uint64_t fb_format_modifier); +uint64_t fb_format_modifier,unsigned int plane);static inline bool intel_rotation_90_or_270 (unsigned int rotation)
drivers/gpu/drm/i915/intel_sprite.c +1 -1
@@ -233,7 +233,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,if (intel_rotation_90_or_270 (rotation)) {/* stride: Surface height in tiles */ tile_height =intel_tile_height (dev, fb->bits_per_pixel, - fb->modifier[0 ]); + fb->modifier[0 ],0 ); stride =DIV_ROUND_UP (fb->height, tile_height); plane_size = (src_w <<16 ) | src_h; x_offset = stride * tile_height - y - (src_h +1 );
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/8 drm/i915: Remove pointless calculation in intel_rotate_fb_obj_pages
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Leftover from refactoring and it serves no purpose now.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +3 -4
@@ -2686,7 +2686,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, {struct drm_device *dev = obj->base.dev;struct intel_rotation_info *rot_info = &ggtt_view->rotation_info; -unsigned long size, pages, rot_pages; +unsigned long pages, rot_pages;struct sg_page_iter sg_iter;unsigned long i;dma_addr_t *page_addr_list;
@@ -2704,7 +2704,6 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, width_pages =DIV_ROUND_UP (rot_info->pitch, tile_pitch); height_pages =DIV_ROUND_UP (rot_info->height, tile_height); rot_pages = width_pages * height_pages; - size = rot_pages *PAGE_SIZE ;/* Allocate a temporary list of source pages for random access. */ page_addr_list =drm_malloc_ab (pages,sizeof (dma_addr_t));
@@ -2732,7 +2731,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,DRM_DEBUG_KMS ("Created rotated page mapping for object size %lu (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages).\n" , - size, rot_info->pitch, rot_info->height, + obj->base.size, rot_info->pitch, rot_info->height, rot_info->pixel_format, width_pages, height_pages, rot_pages);
@@ -2747,7 +2746,7 @@ err_st_alloc:DRM_DEBUG_KMS ("Failed to create rotated mapping for object size %lu! (%d) (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages)\n" , - size, ret, rot_info->pitch, rot_info->height, + obj->base.size, ret, rot_info->pitch, rot_info->height, rot_info->pixel_format, width_pages, height_pages, rot_pages);return ERR_PTR (ret);
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/8 drm/i915: Extract tiled geometry calculation into a helper function
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
It will be used twice with support for planar NV12.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +20 -7
@@ -2680,6 +2680,24 @@ rotate_pages(dma_addr_t *in, unsigned int width, unsigned int height, } } +static unsigned long +intel_calc_tiled_geometry (struct drm_device *dev, +struct intel_rotation_info *rot_info, +unsigned int *width_pages, +unsigned int *height_pages, +unsigned int plane) +{ +unsigned int tile_height, tile_pitch; + + tile_height =intel_tile_height (dev, rot_info->pixel_format, + rot_info->fb_modifier, plane); + tile_pitch =PAGE_SIZE / tile_height; + *width_pages =DIV_ROUND_UP (rot_info->pitch, tile_pitch); + *height_pages =DIV_ROUND_UP (rot_info->height, tile_height); + +return (*width_pages) * (*height_pages); +} +static struct sg_table *intel_rotate_fb_obj_pages (struct i915_ggtt_view *ggtt_view,struct drm_i915_gem_object *obj)
@@ -2691,19 +2709,14 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,unsigned long i;dma_addr_t *page_addr_list;struct sg_table *st; -unsigned int tile_pitch, tile_height;unsigned int width_pages, height_pages;int ret = -ENOMEM ; pages = obj->base.size /PAGE_SIZE ;/* Calculate tiling geometry. */ - tile_height =intel_tile_height (dev, rot_info->pixel_format, - rot_info->fb_modifier,0 ); - tile_pitch =PAGE_SIZE / tile_height; - width_pages =DIV_ROUND_UP (rot_info->pitch, tile_pitch); - height_pages =DIV_ROUND_UP (rot_info->height, tile_height); - rot_pages = width_pages * height_pages; + rot_pages =intel_calc_tiled_geometry (dev, rot_info, + &width_pages, &height_pages,0 );/* Allocate a temporary list of source pages for random access. */ page_addr_list =drm_malloc_ab (pages,sizeof (dma_addr_t));
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/8 drm/i915: Support appending to the rotated pages mapping
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
By providing a start offset into the source array of pages, and returning the end position in the scatter-gather table, we will be able to append the UV plane to the rotated mapping in later patches.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +12 -7
@@ -2653,15 +2653,18 @@ i915_gem_obj_lookup_or_create_ggtt_vma(struct drm_i915_gem_object *obj, } -static void -rotate_pages (dma_addr_t *in,unsigned int width,unsigned int height, -struct sg_table *st) +static struct scatterlist * +rotate_pages (dma_addr_t *in,unsigned int offset, +unsigned int width,unsigned int height, +struct sg_table *st,struct scatterlist *sg) {unsigned int column, row;unsigned int src_idx; -struct scatterlist *sg = st->sgl; - st->nents =0 ; +if (!sg) { + st->nents =0 ; + sg = st->sgl; + }for (column =0 ; column < width; column++) { src_idx = width * (height -1 ) + column;
@@ -2672,12 +2675,14 @@ rotate_pages(dma_addr_t *in, unsigned int width, unsigned int height,* The only thing we need are DMA addresses. */ sg_set_page (sg,NULL ,PAGE_SIZE ,0 ); -sg_dma_address (sg) = in[src_idx]; +sg_dma_address (sg) = in[offset + src_idx];sg_dma_len (sg) =PAGE_SIZE ; sg =sg_next (sg); src_idx -= width; } } + +return sg; } static unsigned long
@@ -2740,7 +2745,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, }/* Rotate the pages. */ -rotate_pages (page_addr_list, width_pages, height_pages, st); +rotate_pages (page_addr_list,0 , width_pages, height_pages, st,NULL ); DRM_DEBUG_KMS( "Created rotated page mapping for object size %lu (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages).\n",
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/8 drm/i915: Support NV12 in rotated GGTT mapping
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Just adding the rotated UV plane at the end of the rotated Y plane.
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 47 ++++++++++++++++++++++++++++++------ drivers/gpu/drm/i915/i915_gem_gtt.h | 1 + drivers/gpu/drm/i915/intel_display.c | 1 + 3 files changed, 41 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +39 -8
@@ -2693,12 +2693,18 @@ intel_calc_tiled_geometry(struct drm_device *dev, unsigned int plane) {unsigned int tile_height, tile_pitch; +unsigned int height; + +if (rot_info->pixel_format ==DRM_FORMAT_NV12 && plane ==1 ) + height = rot_info->height /2 ; +else + height = rot_info->height; tile_height =intel_tile_height (dev, rot_info->pixel_format, rot_info->fb_modifier, plane); tile_pitch =PAGE_SIZE / tile_height; *width_pages =DIV_ROUND_UP (rot_info->pitch, tile_pitch); - *height_pages =DIV_ROUND_UP (rot_info->height, tile_height); + *height_pages =DIV_ROUND_UP (height, tile_height);return (*width_pages) * (*height_pages); }
@@ -2709,12 +2715,15 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, {struct drm_device *dev = obj->base.dev;struct intel_rotation_info *rot_info = &ggtt_view->rotation_info; -unsigned long pages, rot_pages; +unsigned long pages, rot_pages, rot_pages_uv =0 ;struct sg_page_iter sg_iter;unsigned long i;dma_addr_t *page_addr_list;struct sg_table *st;unsigned int width_pages, height_pages; +unsigned int width_pages_uv, height_pages_uv; +unsigned int uv_start_page; +struct scatterlist *sg;int ret = -ENOMEM ; pages = obj->base.size /PAGE_SIZE ;
@@ -2723,6 +2732,13 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, rot_pages =intel_calc_tiled_geometry (dev, rot_info, &width_pages, &height_pages,0 ); +/* Account for UV plane with NV12. */ +if (rot_info->pixel_format ==DRM_FORMAT_NV12 ) { + rot_pages_uv =intel_calc_tiled_geometry (dev, rot_info, + &width_pages_uv, + &height_pages_uv,1 ); + } +/* Allocate a temporary list of source pages for random access. */ page_addr_list =drm_malloc_ab (pages,sizeof (dma_addr_t));if (!page_addr_list)
@@ -2733,7 +2749,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,if (!st) goto err_st_alloc; - ret =sg_alloc_table (st, rot_pages,GFP_KERNEL ); + ret =sg_alloc_table (st, rot_pages + rot_pages_uv,GFP_KERNEL );if (ret) goto err_sg_alloc;
@@ -2745,13 +2761,28 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, }/* Rotate the pages. */ -rotate_pages (page_addr_list,0 , width_pages, height_pages, st,NULL ); + sg =rotate_pages (page_addr_list,0 , + width_pages, height_pages, + st,NULL ); + +/* Append the UV plane if NV12. */ +if (rot_info->pixel_format ==DRM_FORMAT_NV12 ) { + uv_start_page = rot_pages; + +/* Check for tile-row un-alignment. */ +if (offset_in_page (rot_info->uv_offset)) + uv_start_page--; + +rotate_pages (page_addr_list, uv_start_page, + width_pages_uv, height_pages_uv, + st, sg); + }DRM_DEBUG_KMS ( -"Created rotated page mapping for object size %lu (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages).\n" , +"Created rotated page mapping for object size %lu (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages (%lu plane 0)).\n" , obj->base.size, rot_info->pitch, rot_info->height, rot_info->pixel_format, width_pages, height_pages, - rot_pages); + rot_pages + rot_pages_uv, rot_pages);drm_free_large (page_addr_list);
@@ -2763,10 +2794,10 @@ err_st_alloc:drm_free_large (page_addr_list);DRM_DEBUG_KMS ( -"Failed to create rotated mapping for object size %lu! (%d) (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages)\n" , +"Failed to create rotated mapping for object size %lu! (%d) (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %lu pages (%lu plane 0))\n" , obj->base.size, ret, rot_info->pitch, rot_info->height, rot_info->pixel_format, width_pages, height_pages, - rot_pages); + rot_pages + rot_pages_uv, rot_pages);return ERR_PTR (ret); }
drivers/gpu/drm/i915/i915_gem_gtt.h +1 -0
@@ -123,6 +123,7 @@ enum i915_ggtt_view_type {struct intel_rotation_info {unsigned int height;unsigned int pitch; +unsigned int uv_offset;uint32_t pixel_format;uint64_t fb_modifier; };
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -2346,6 +2346,7 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb, info->pixel_format = fb->pixel_format; info->pitch = fb->pitches[0 ]; info->fb_modifier = fb->modifier[0 ]; + info->uv_offset = fb->offsets[1 ];return 0 ; }
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/8 drm/i915: Enable querying offset of UV plane with intel_plane_obj_offset
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Do we need this?
--- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++ drivers/gpu/drm/i915/i915_gem_gtt.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 27 ++++++++++++++++++++++----- drivers/gpu/drm/i915/intel_drv.h | 3 ++- drivers/gpu/drm/i915/intel_sprite.c | 2 +- 5 files changed, 29 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -0
@@ -2773,6 +2773,8 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,if (offset_in_page (rot_info->uv_offset)) uv_start_page--; + rot_info->uv_start_page = uv_start_page; +rotate_pages (page_addr_list, uv_start_page, width_pages_uv, height_pages_uv, st, sg);
drivers/gpu/drm/i915/i915_gem_gtt.h +2 -0
@@ -126,6 +126,8 @@ struct intel_rotation_info {unsigned int uv_offset;uint32_t pixel_format;uint64_t fb_modifier; + +unsigned int uv_start_page; };struct i915_ggtt_view {
drivers/gpu/drm/i915/intel_display.c +22 -5
@@ -2933,14 +2933,30 @@ 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) +struct drm_i915_gem_object *obj, +unsigned int plane) {const struct i915_ggtt_view *view = &i915_ggtt_view_normal; +struct i915_vma *vma; +unsigned char *offset; +unsigned long uv_start;if (intel_rotation_90_or_270 (intel_plane->base.state->rotation)) view = &i915_ggtt_view_rotated; -return i915_gem_obj_ggtt_offset_view (obj, view); + vma =i915_gem_obj_to_ggtt_view (obj, view); +if (WARN (!vma,"ggtt vma for display object not found! (view=%u)\n" , + view->type)) +return -1 ; + + offset = (unsigned char *)vma->node.start; + +if (plane ==1 ) { + uv_start = vma->ggtt_view.rotation_info.uv_start_page; + offset += uv_start *PAGE_SIZE ; + } + +return (unsigned long )offset; }/*
@@ -3115,7 +3131,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, obj =intel_fb_obj (fb); stride_div =intel_fb_stride_alignment (dev, fb->modifier[0 ], fb->pixel_format); - surf_addr =intel_plane_obj_offset (to_intel_plane (plane), obj); + surf_addr =intel_plane_obj_offset (to_intel_plane (plane), obj,0 );/* * FIXME: intel_plane_state->src, dst aren't set when transitional
@@ -11082,8 +11098,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,if (ret) goto cleanup_pending; - work->gtt_offset =intel_plane_obj_offset (to_intel_plane (primary), obj) - + intel_crtc->dspaddr_offset; + work->gtt_offset =intel_plane_obj_offset (to_intel_plane (primary), + obj,0 ); + work->gtt_offset += intel_crtc->dspaddr_offset;if (mmio_flip) { ret = intel_queue_mmio_flip(dev, crtc, fb, obj, ring,
drivers/gpu/drm/i915/intel_drv.h +2 -1
@@ -1142,7 +1142,8 @@ int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, uint32_t pixel_format);unsigned long intel_plane_obj_offset (struct intel_plane *intel_plane, -struct drm_i915_gem_object *obj); +struct drm_i915_gem_object *obj, +unsigned int plane);u32 skl_plane_ctl_format (uint32_t pixel_format);u32 skl_plane_ctl_tiling (uint64_t fb_modifier);u32 skl_plane_ctl_rotation (unsigned int rotation);
drivers/gpu/drm/i915/intel_sprite.c +1 -1
@@ -228,7 +228,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,else if (key->flags &I915_SET_COLORKEY_SOURCE ) plane_ctl |=PLANE_CTL_KEY_ENABLE_SOURCE ; - surf_addr =intel_plane_obj_offset (intel_plane, obj); + surf_addr =intel_plane_obj_offset (intel_plane, obj,0 );if (intel_rotation_90_or_270 (rotation)) {/* stride: Surface height in tiles */
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/8 drm/i915: Allow NV12 with 90/270 rotation
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -2
@@ -183,14 +183,13 @@ static int intel_plane_atomic_check(struct drm_plane *plane,/* * 90/270 is not allowed with RGB64 16:16:16:16, -* RGB 16-bit 5:6:5, and Indexed 8-bit. +* RGB 16-bit 5:6:5, Indexed 8-bit and NV12. * TBD: Add RGB64 case once its added in supported format list. * TBD: Remove NV12, once its 90/270 remapping is supported */ switch (state->fb->pixel_format) {case DRM_FORMAT_C8 :case DRM_FORMAT_RGB565 : -case DRM_FORMAT_NV12 :DRM_DEBUG_KMS ("Unsupported pixel format %s for 90/270!\n" ,drm_get_format_name (state->fb->pixel_format));return -EINVAL ;
Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 8/8] drm/i915: Allow NV12 with 90/270 rotation
Task id: 6356 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV 276/276 276/276 ILK 302/302 302/302 SNB 316/316 316/316 IVB 342/342 342/342 BYT 286/286 286/286 BDW 318/318 318/318
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
First attempt at rotated GGTT mapping for the NV12 format.
It compiles and even does not crash on first use. But some parts are probably too simplistic at the moment and need further polish.
Sending out early since Chandra needs this to complete his display programming patches.
Depends on Chandra's NV12 patch series.
I don't know how you split up the work, but there's also adjustments to be done in the DDB allocation and WM code for rotated NV12 buffers and I don't see that in either of your series (I think).
The natural assignee is probably Chandra as he's already working on the the NV12 DDB/WM code.
Signature · 1 line
Damien
Quoted 11 lines
Tvrtko Ursulin (8):
drm/i915: Remove duplicatedintel_tile_heightdeclaration drm/i915: Support planar formats in tile height calculations drm/i915: Remove pointless calculation inintel_rotate_fb_obj_pagesdrm/i915: Extract tiled geometry calculation into a helper function drm/i915: Support appending to the rotated pages mapping drm/i915: Support NV12 in rotated GGTT mapping
drm/i915: Enable querying offset of UV plane with
intel_plane_obj_offset
drm/i915: Allow NV12 with 90/270 rotation
Quoted 15 lines
drivers/gpu/drm/i915/i915_gem_gtt.c | 96 +++++++++++++++++++++++-------- drivers/gpu/drm/i915/i915_gem_gtt.h | 3 + drivers/gpu/drm/i915/intel_atomic_plane.c | 3 +- drivers/gpu/drm/i915/intel_display.c | 36 +++++++++--- drivers/gpu/drm/i915/intel_drv.h | 8 +-- drivers/gpu/drm/i915/intel_sprite.c | 4 +- 6 files changed, 109 insertions(+), 41 deletions(-)Signature · 6 lines
2.4.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Damien Lespiau
Quoted 10 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
First attempt at rotated GGTT mapping for the NV12 format.
It compiles and even does not crash on first use. But some parts are probably too simplistic at the moment and need further polish.
Sending out early since Chandra needs this to complete his display programming patches.
Quoted 8 lines
Quoted 1 line
Depends on Chandra's NV12 patch series.
I don't know how you split up the work, but there's also adjustments to be done in the DDB allocation and WM code for rotated NV12 buffers and I don't see that in either of your series (I think).
The natural assignee is probably Chandra as he's already working on the the NV12 DDB/WM code.
Yes that is the plan, I have just the GTT remapping on my plate.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx