[PATCH 9/9] drm/exynos: unify exynos_drm_plane names with drm core

Inki Dae inki.dae at samsung.com
Wed Jun 10 03:42:34 PDT 2015


Hi Gustavo,

On 2015년 06월 09일 23:27, Gustavo Padovan wrote:
> Hi Inki and Joonyoung,
> 
> Any comments on this series?

As you may know, I'm reviewing and testing iommu support patch series
posted by Marek. With the patch series, I faced with page fault issue
while booting like below,

[    1.161282] [drm] Initialized drm 1.1.0 20060810
[    1.168972] exynos-drm exynos-drm: bound exynos-drm-vidi (ops
vidi_component_ops)
[    1.178462] ------------[ cut here ]------------
[    1.181610] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/drm_irq.c:1718
drm_handle_vblank+0x2a0/0x308()
[    1.190710] Modules linked in:
[    1.193754] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.1.0-rc4-00564-g9acf8e2-dirty #1385
[    1.201995] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[    1.208094] [<c0015388>] (unwind_backtrace) from [<c0012440>]
(show_stack+0x10/0x14)
[    1.215810] [<c0012440>] (show_stack) from [<c04a35b8>]
(dump_stack+0x84/0xc4)
[    1.223014] [<c04a35b8>] (dump_stack) from [<c00245cc>]
(warn_slowpath_common+0x80/0xb0)
[    1.223059] exynos-drm exynos-drm: bound 11c00000.fimd (ops
fimd_component_ops)
[    1.223403] exynos-drm exynos-drm: bound 11c80000.dsi (ops
exynos_dsi_component_ops)
[    1.223408] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.223411] [drm] No driver support for vblank timestamp query.
[    1.223455] [drm] Initialized exynos 1.0.0 20110530 on minor 0
[    1.264427] [<c00245cc>] (warn_slowpath_common) from [<c0024698>]
(warn_slowpath_null+0x1c/0x24)
[    1.273184] [<c0024698>] (warn_slowpath_null) from [<c027c394>]
(drm_handle_vblank+0x2a0/0x308)
[    1.281872] [<c027c394>] (drm_handle_vblank) from [<c0298964>]
(fimd_irq_handler+0x78/0xcc)
[    1.290201] [<c0298964>] (fimd_irq_handler) from [<c0060708>]
(handle_irq_event_percpu+0x78/0x134)
[    1.299134] [<c0060708>] (handle_irq_event_percpu) from [<c0060800>]
(handle_irq_event+0x3c/0x5c)
[    1.307994] [<c0060800>] (handle_irq_event) from [<c00634a8>]
(handle_level_irq+0xc4/0x13c)
[    1.308007] [<c00634a8>] (handle_level_irq) from [<c005fd8c>]
(generic_handle_irq+0x2c/0x3c)
[    1.308021] [<c005fd8c>] (generic_handle_irq) from [<c02010cc>]
(combiner_handle_cascade_irq+0x94/0x100)
[    1.308032] [<c02010cc>] (combiner_handle_cascade_irq) from
[<c005fd8c>] (generic_handle_irq+0x2c/0x3c)
[    1.308042] [<c005fd8c>] (generic_handle_irq) from [<c0060058>]
(__handle_domain_irq+0x7c/0xec)
[    1.308052] [<c0060058>] (__handle_domain_irq) from [<c0009434>]
(gic_handle_irq+0x30/0x68)
[    1.308060] [<c0009434>] (gic_handle_irq) from [<c0012f40>]
(__irq_svc+0x40/0x74)
[    1.308065] Exception stack(0xc06dbf68 to 0xc06dbfb0)
[    1.308072] bf60:                   00000000 00000000 00001298
c001cc80 c06da000 c06dc4f8
[    1.308080] bf80: c04abf50 c06d62c4 c06dbfb8 c070c121 00000001
00000000 01000000 c06dbfb0
[    1.308085] bfa0: c0010064 c0010068 60000113 ffffffff
[    1.308099] [<c0012f40>] (__irq_svc) from [<c0010068>]
(arch_cpu_idle+0x38/0x3c)
[    1.308113] [<c0010068>] (arch_cpu_idle) from [<c0054358>]
(cpu_startup_entry+0x12c/0x1c4)
[    1.308129] [<c0054358>] (cpu_startup_entry) from [<c0688c54>]
(start_kernel+0x398/0x3a4)
[    1.308140] [<c0688c54>] (start_kernel) from [<4000807c>] (0x4000807c)
[    1.308157] ---[ end trace 489a69b2a98f6c1d ]---
[    1.341264] random: nonblocking pool is initialized
[    4.235177] panel_s6e8aa0 11c80000.dsi.0: ID: 0xa2, 0x60, 0x90
[    4.436180] Console: switching to colour frame buffer device 102x91
[    4.592094] exynos-drm exynos-drm: fb0:  frame buffer device
[    4.597734] exynos-drm exynos-drm: registered panic notifier


Enabling IOMMU makes DMA device more sensitive so it seems that hided
issues happen with iommu support. In this time, let's have more reviews.
Look like that now atomic features aren't safe yet.

Thanks,
Inki Dae

> 
> 2015-06-03 Gustavo Padovan <gustavo at padovan.org>:
> 
>> From: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
>>
>> Rename crtc_{widht,height} to crtc_{w,h} and src_{width,height} to
>> src_{w,h} to make it similar to the atomic state names.
>>
>> Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
>> ---
>>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 14 +++++++-------
>>  drivers/gpu/drm/exynos/exynos_drm_drv.h    | 16 ++++++++--------
>>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 14 +++++++-------
>>  drivers/gpu/drm/exynos/exynos_drm_plane.c  | 11 ++++++-----
>>  drivers/gpu/drm/exynos/exynos_mixer.c      | 22 +++++++++++-----------
>>  5 files changed, 39 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>> index 7a99237..4e63a9c 100644
>> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>> @@ -442,25 +442,25 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
>>  	DRM_DEBUG_KMS("start addr = 0x%lx\n",
>>  			(unsigned long)val);
>>  	DRM_DEBUG_KMS("ovl_width = %d, ovl_height = %d\n",
>> -			plane->crtc_width, plane->crtc_height);
>> +			plane->crtc_w, plane->crtc_h);
>>  
>>  	/*
>>  	 * OSD position.
>>  	 * In case the window layout goes of LCD layout, DECON fails.
>>  	 */
>> -	if ((plane->crtc_x + plane->crtc_width) > mode->hdisplay)
>> -		plane->crtc_x = mode->hdisplay - plane->crtc_width;
>> -	if ((plane->crtc_y + plane->crtc_height) > mode->vdisplay)
>> -		plane->crtc_y = mode->vdisplay - plane->crtc_height;
>> +	if ((plane->crtc_x + plane->crtc_w) > mode->hdisplay)
>> +		plane->crtc_x = mode->hdisplay - plane->crtc_w;
>> +	if ((plane->crtc_y + plane->crtc_h) > mode->vdisplay)
>> +		plane->crtc_y = mode->vdisplay - plane->crtc_h;
>>  
>>  	val = VIDOSDxA_TOPLEFT_X(plane->crtc_x) |
>>  		VIDOSDxA_TOPLEFT_Y(plane->crtc_y);
>>  	writel(val, ctx->regs + VIDOSD_A(win));
>>  
>> -	last_x = plane->crtc_x + plane->crtc_width;
>> +	last_x = plane->crtc_x + plane->crtc_w;
>>  	if (last_x)
>>  		last_x--;
>> -	last_y = plane->crtc_y + plane->crtc_height;
>> +	last_y = plane->crtc_y + plane->crtc_h;
>>  	if (last_y)
>>  		last_y--;
>>  
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
>> index b83d487..7c6196e 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
>> @@ -51,12 +51,12 @@ enum exynos_drm_output_type {
>>   *	- the unit is screen coordinates.
>>   * @src_y: offset y on a framebuffer to be displayed.
>>   *	- the unit is screen coordinates.
>> - * @src_width: width of a partial image to be displayed from framebuffer.
>> - * @src_height: height of a partial image to be displayed from framebuffer.
>> + * @src_w: width of a partial image to be displayed from framebuffer.
>> + * @src_h: height of a partial image to be displayed from framebuffer.
>>   * @crtc_x: offset x on hardware screen.
>>   * @crtc_y: offset y on hardware screen.
>> - * @crtc_width: window width to be displayed (hardware screen).
>> - * @crtc_height: window height to be displayed (hardware screen).
>> + * @crtc_w: window width to be displayed (hardware screen).
>> + * @crtc_h: window height to be displayed (hardware screen).
>>   * @h_ratio: horizontal scaling ratio, 16.16 fixed point
>>   * @v_ratio: vertical scaling ratio, 16.16 fixed point
>>   * @dma_addr: array of bus(accessed by dma) address to the memory region
>> @@ -73,12 +73,12 @@ struct exynos_drm_plane {
>>  	struct drm_plane base;
>>  	unsigned int src_x;
>>  	unsigned int src_y;
>> -	unsigned int src_width;
>> -	unsigned int src_height;
>> +	unsigned int src_w;
>> +	unsigned int src_h;
>>  	unsigned int crtc_x;
>>  	unsigned int crtc_y;
>> -	unsigned int crtc_width;
>> -	unsigned int crtc_height;
>> +	unsigned int crtc_w;
>> +	unsigned int crtc_h;
>>  	unsigned int h_ratio;
>>  	unsigned int v_ratio;
>>  	dma_addr_t dma_addr[MAX_FB_BUFFER];
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> index 2ece83b..920727b 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> @@ -659,18 +659,18 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
>>  	writel(val, ctx->regs + VIDWx_BUF_START(win, 0));
>>  
>>  	/* buffer end address */
>> -	size = pitch * plane->crtc_height;
>> +	size = pitch * plane->crtc_h;
>>  	val = (unsigned long)(dma_addr + size);
>>  	writel(val, ctx->regs + VIDWx_BUF_END(win, 0));
>>  
>>  	DRM_DEBUG_KMS("start addr = 0x%lx, end addr = 0x%lx, size = 0x%lx\n",
>>  			(unsigned long)dma_addr, val, size);
>>  	DRM_DEBUG_KMS("ovl_width = %d, ovl_height = %d\n",
>> -			plane->crtc_width, plane->crtc_height);
>> +			plane->crtc_w, plane->crtc_h);
>>  
>>  	/* buffer size */
>> -	buf_offsize = pitch - (plane->crtc_width * bpp);
>> -	line_size = plane->crtc_width * bpp;
>> +	buf_offsize = pitch - (plane->crtc_w * bpp);
>> +	line_size = plane->crtc_w * bpp;
>>  	val = VIDW_BUF_SIZE_OFFSET(buf_offsize) |
>>  		VIDW_BUF_SIZE_PAGEWIDTH(line_size) |
>>  		VIDW_BUF_SIZE_OFFSET_E(buf_offsize) |
>> @@ -684,10 +684,10 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
>>  		VIDOSDxA_TOPLEFT_Y_E(plane->crtc_y);
>>  	writel(val, ctx->regs + VIDOSD_A(win));
>>  
>> -	last_x = plane->crtc_x + plane->crtc_width;
>> +	last_x = plane->crtc_x + plane->crtc_w;
>>  	if (last_x)
>>  		last_x--;
>> -	last_y = plane->crtc_y + plane->crtc_height;
>> +	last_y = plane->crtc_y + plane->crtc_h;
>>  	if (last_y)
>>  		last_y--;
>>  
>> @@ -704,7 +704,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,
>>  		u32 offset = VIDOSD_D(win);
>>  		if (win == 0)
>>  			offset = VIDOSD_C(win);
>> -		val = plane->crtc_width * plane->crtc_height;
>> +		val = plane->crtc_w * plane->crtc_h;
>>  		writel(val, ctx->regs + offset);
>>  
>>  		DRM_DEBUG_KMS("osd size = 0x%x\n", (unsigned int)val);
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
>> index 9602797..bebc957 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
>> @@ -97,17 +97,18 @@ static void exynos_plane_mode_set(struct drm_plane *plane,
>>  	/* set drm framebuffer data. */
>>  	exynos_plane->src_x = src_x;
>>  	exynos_plane->src_y = src_y;
>> -	exynos_plane->src_width = (actual_w * exynos_plane->h_ratio) >> 16;
>> -	exynos_plane->src_height = (actual_h * exynos_plane->v_ratio) >> 16;
>> +	exynos_plane->src_w = (actual_w * exynos_plane->h_ratio) >> 16;
>> +	exynos_plane->src_h = (actual_h * exynos_plane->v_ratio) >> 16;
>>  
>>  	/* set plane range to be displayed. */
>>  	exynos_plane->crtc_x = crtc_x;
>>  	exynos_plane->crtc_y = crtc_y;
>> -	exynos_plane->crtc_width = actual_w;
>> -	exynos_plane->crtc_height = actual_h;
>> +	exynos_plane->crtc_w = actual_w;
>> +	exynos_plane->crtc_h = actual_h;
>> +
>>  	DRM_DEBUG_KMS("plane : offset_x/y(%d,%d), width/height(%d,%d)",
>>  			exynos_plane->crtc_x, exynos_plane->crtc_y,
>> -			exynos_plane->crtc_width, exynos_plane->crtc_height);
>> +			exynos_plane->crtc_w, exynos_plane->crtc_h);
>>  
>>  	plane->crtc = crtc;
>>  }
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index 4fbafc9..f8ef8c6 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>> @@ -443,19 +443,19 @@ static void vp_video_buffer(struct mixer_context *ctx,
>>  	vp_reg_write(res, VP_IMG_SIZE_C, VP_IMG_HSIZE(fb->pitches[0]) |
>>  		VP_IMG_VSIZE(fb->height / 2));
>>  
>> -	vp_reg_write(res, VP_SRC_WIDTH, plane->src_width);
>> -	vp_reg_write(res, VP_SRC_HEIGHT, plane->src_height);
>> +	vp_reg_write(res, VP_SRC_WIDTH, plane->src_w);
>> +	vp_reg_write(res, VP_SRC_HEIGHT, plane->src_h);
>>  	vp_reg_write(res, VP_SRC_H_POSITION,
>>  			VP_SRC_H_POSITION_VAL(plane->src_x));
>>  	vp_reg_write(res, VP_SRC_V_POSITION, plane->src_y);
>>  
>> -	vp_reg_write(res, VP_DST_WIDTH, plane->crtc_width);
>> +	vp_reg_write(res, VP_DST_WIDTH, plane->crtc_w);
>>  	vp_reg_write(res, VP_DST_H_POSITION, plane->crtc_x);
>>  	if (ctx->interlace) {
>> -		vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_height / 2);
>> +		vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_h / 2);
>>  		vp_reg_write(res, VP_DST_V_POSITION, plane->crtc_y / 2);
>>  	} else {
>> -		vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_height);
>> +		vp_reg_write(res, VP_DST_HEIGHT, plane->crtc_h);
>>  		vp_reg_write(res, VP_DST_V_POSITION, plane->crtc_y);
>>  	}
>>  
>> @@ -492,15 +492,15 @@ static void mixer_layer_update(struct mixer_context *ctx)
>>  static int mixer_setup_scale(const struct exynos_drm_plane *plane,
>>  		unsigned int *x_ratio, unsigned int *y_ratio)
>>  {
>> -	if (plane->crtc_width != plane->src_width) {
>> -		if (plane->crtc_width == 2 * plane->src_width)
>> +	if (plane->crtc_w != plane->src_w) {
>> +		if (plane->crtc_w == 2 * plane->src_w)
>>  			*x_ratio = 1;
>>  		else
>>  			goto fail;
>>  	}
>>  
>> -	if (plane->crtc_height != plane->src_height) {
>> -		if (plane->crtc_height == 2 * plane->src_height)
>> +	if (plane->crtc_h != plane->src_h) {
>> +		if (plane->crtc_h == 2 * plane->src_h)
>>  			*y_ratio = 1;
>>  		else
>>  			goto fail;
>> @@ -589,8 +589,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
>>  		mixer_reg_write(res, MXR_RESOLUTION, val);
>>  	}
>>  
>> -	val  = MXR_GRP_WH_WIDTH(plane->src_width);
>> -	val |= MXR_GRP_WH_HEIGHT(plane->src_height);
>> +	val  = MXR_GRP_WH_WIDTH(plane->src_w);
>> +	val |= MXR_GRP_WH_HEIGHT(plane->src_h);
>>  	val |= MXR_GRP_WH_H_SCALE(x_ratio);
>>  	val |= MXR_GRP_WH_V_SCALE(y_ratio);
>>  	mixer_reg_write(res, MXR_GRAPHIC_WH(win), val);
>> -- 
>> 2.1.0
>>
> 
> 	Gustavo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



More information about the dri-devel mailing list