1
0
Fork 0

MLK-17923 drm/imx: dpu: plane: Do not support fb x/y src offset for tile fmts

We don't have correct support for fb x/y source offset for tile formats.
The buffer address calculation is wrong when the offset is non-zero.
Also, finer offset needs a fix in silicon(TKT344978).  So, let's do not
support the offset currently.  We may add it back after we figure out
how the updated silicon supports the offset.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
pull/10/head
Liu Ying 2018-03-26 16:19:37 +08:00 committed by Jason Liu
parent 15e28b81fc
commit efee8da9f7
6 changed files with 5 additions and 100 deletions

View File

@ -165,27 +165,6 @@ drm_plane_state_to_baseaddr(struct drm_plane_state *state)
cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
BUG_ON(!cma_obj);
/* round down x/y to be tile aligned at left/top */
switch (fb->modifier) {
case DRM_FORMAT_MOD_NONE:
break;
case DRM_FORMAT_MOD_AMPHION_TILED:
x = round_down(x, 8);
y = round_down(y, 256);
break;
case DRM_FORMAT_MOD_VIVANTE_TILED:
x = round_down(x, 4);
y = round_down(y, 4);
break;
case DRM_FORMAT_MOD_VIVANTE_SUPER_TILED:
x = round_down(x, 64);
y = round_down(y, 64);
break;
default:
WARN_ON(1);
break;
}
return cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y +
drm_format_plane_cpp(fb->format->format, 0) * x;
}
@ -204,12 +183,6 @@ drm_plane_state_to_uvbaseaddr(struct drm_plane_state *state)
x /= drm_format_horz_chroma_subsampling(fb->format->format);
y /= drm_format_vert_chroma_subsampling(fb->format->format);
/* round down x/y to be tile aligned at left/top */
if (fb->modifier == DRM_FORMAT_MOD_AMPHION_TILED) {
x = round_down(x, 8);
y = round_down(y, 128);
}
return cma_obj->paddr + fb->offsets[1] + fb->pitches[1] * y +
drm_format_plane_cpp(fb->format->format, 1) * x;
}
@ -259,6 +232,9 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
fb->modifier != DRM_FORMAT_MOD_VIVANTE_SUPER_TILED)
return -EINVAL;
if (fb->modifier && (src_x || src_y))
return -EINVAL;
if (dplane->grp->has_vproc) {
/* no down scaling */
if (src_w > state->crtc_w || src_h > state->crtc_h)
@ -329,8 +305,7 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
fetchdecode_prefetch_stride_supported(fd, fb->pitches[0],
fb->pitches[1],
src_w,
fb->format->format) &&
fetchdecode_prefetch_crop_supported(fd, fb->modifier, src_y))
fb->format->format))
dpstate->use_prefetch = true;
else
dpstate->use_prefetch = false;

View File

@ -830,16 +830,6 @@ bool fetchdecode_prefetch_stride_supported(struct dpu_fetchdecode *fd,
}
EXPORT_SYMBOL_GPL(fetchdecode_prefetch_stride_supported);
bool fetchdecode_prefetch_crop_supported(struct dpu_fetchdecode *fd,
u64 modifier, u32 y_offset)
{
if (WARN_ON(!fd || !fd->dprc))
return false;
return dprc_crop_supported(fd->dprc, modifier, y_offset);
}
EXPORT_SYMBOL_GPL(fetchdecode_prefetch_crop_supported);
bool fetchdecode_prefetch_stride_double_check(struct dpu_fetchdecode *fd,
unsigned int stride,
unsigned int uv_stride,

View File

@ -605,30 +605,6 @@ bool dprc_stride_supported(struct dprc *dprc,
}
EXPORT_SYMBOL_GPL(dprc_stride_supported);
bool dprc_crop_supported(struct dprc *dprc, u64 modifier, u32 y_offset)
{
if (WARN_ON(!dprc))
return false;
switch (modifier) {
case DRM_FORMAT_MOD_AMPHION_TILED:
if ((y_offset % AMPHION_Y_STRIPE_HEIGHT) >
(PRG_HANDSHAKE_8LINES - 1))
return false;
break;
case DRM_FORMAT_MOD_VIVANTE_SUPER_TILED:
if ((y_offset % VIVANTE_SUPER_TILE_HEIGHT) >
(PRG_HANDSHAKE_4LINES - 1))
return false;
break;
default:
break;
}
return true;
}
EXPORT_SYMBOL_GPL(dprc_crop_supported);
bool dprc_stride_double_check(struct dprc *dprc,
unsigned int stride, unsigned int uv_stride,
unsigned int width, u32 format,

View File

@ -1,5 +1,5 @@
/*
* Copyright 2017 NXP
* Copyright 2017-2018 NXP
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -149,42 +149,9 @@ void prg_configure(struct prg *prg, unsigned int width, unsigned int height,
if (prg->is_auxiliary && stride <= burst_size)
height /= 2;
/* prg finer cropping into tile block - top/left start point */
switch (modifier) {
case DRM_FORMAT_MOD_NONE:
break;
case DRM_FORMAT_MOD_AMPHION_TILED:
x_offset %= AMPHION_STRIPE_WIDTH;
y_offset %= (prg->is_auxiliary ?
AMPHION_UV_STRIPE_HEIGHT : AMPHION_Y_STRIPE_HEIGHT);
break;
case DRM_FORMAT_MOD_VIVANTE_TILED:
x_offset %= VIVANTE_TILE_WIDTH;
y_offset %= VIVANTE_TILE_HEIGHT;
break;
case DRM_FORMAT_MOD_VIVANTE_SUPER_TILED:
x_offset %= VIVANTE_SUPER_TILE_WIDTH;
y_offset %= VIVANTE_SUPER_TILE_HEIGHT;
break;
default:
dev_err(prg->dev, "unsupported modifier 0x%016llx\n",
modifier);
return;
}
if (y_offset >
((format == DRM_FORMAT_NV21 || format == DRM_FORMAT_NV12) ?
(PRG_HANDSHAKE_8LINES - 1) : (PRG_HANDSHAKE_4LINES - 1))) {
dev_err(prg->dev,
"unsupported crop line %d for modifier 0x%016llx\n",
y_offset, modifier);
return;
}
prg_write(prg, STRIDE(stride), PRG_STRIDE);
prg_write(prg, WIDTH(width), PRG_WIDTH);
prg_write(prg, HEIGHT(height), PRG_HEIGHT);
prg_write(prg, X(x_offset) | Y(y_offset), PRG_OFFSET);
prg_write(prg, baddr, PRG_BADDR);
val = prg_read(prg, PRG_CTRL);

View File

@ -526,8 +526,6 @@ bool fetchdecode_prefetch_stride_supported(struct dpu_fetchdecode *fd,
unsigned int uv_stride,
unsigned int width,
u32 format);
bool fetchdecode_prefetch_crop_supported(struct dpu_fetchdecode *fd,
u64 modifier, u32 y_offset);
bool fetchdecode_prefetch_stride_double_check(struct dpu_fetchdecode *fd,
unsigned int stride,
unsigned int uv_stride,

View File

@ -62,7 +62,6 @@ bool dprc_format_supported(struct dprc *dprc, u32 format, u64 modifier);
bool dprc_stride_supported(struct dprc *dprc,
unsigned int stride, unsigned int uv_stride,
unsigned int width, u32 format);
bool dprc_crop_supported(struct dprc *dprc, u64 modifier, u32 y_offset);
bool dprc_stride_double_check(struct dprc *dprc,
unsigned int stride, unsigned int uv_stride,
unsigned int width, u32 format,