lkml.org 
[lkml]   [2019]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] drm/hisilicon: Added three new resolutions and changed the alignment to 128 Bytes
Hi Tian,

On Sat, 28 Dec 2019 at 01:14, Tian Tao <tiantao6@hisilicon.com> wrote:
> @@ -118,11 +119,9 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane,
> writel(gpu_addr, priv->mmio + HIBMC_CRT_FB_ADDRESS);
>
> reg = state->fb->width * (state->fb->format->cpp[0]);
> - /* now line_pad is 16 */
> - reg = PADDING(16, reg);
>
> line_l = state->fb->width * state->fb->format->cpp[0];
> - line_l = PADDING(16, line_l);
> + line_l = PADDING(128, line_l);

The 'line length' here is the 'stride' field of the FB. Stride is set
by userspace when allocating the buffer, and the kernel must not
attempt to guess what userspace set.

You should use state->fb->strides[0] directly here, and in your
atomic_check() function, make sure that the framebuffer stride is
correctly aligned.

Please split this into a separate change. Your commit has three
changes in it, which should all be separate commits:
* enforce 128-byte stride alignment (is this a hardware limit?)
* get the BO from drm_fb rather than hibmc_fb (can hibmc_fb->obj
just be removed now?)
* add new clock/resolution configurations

Cheers,
Daniel

\
 
 \ /
  Last update: 2019-12-30 11:25    [W:0.034 / U:52.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site