Skip to content

Commit b3f8120

Browse files
pcercueigregkh
authored andcommitted
drm/ingenic: Switch IPU plane to type OVERLAY
commit 68b433f upstream. It should have been an OVERLAY from the beginning. The documentation stipulates that there should be an unique PRIMARY plane per CRTC. Fixes: fc1acf3 ("drm/ingenic: Add support for the IPU") Cc: <stable@vger.kernel.org> # 5.8+ Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Simon Ser <contact@emersion.fr> Link: https://patchwork.freedesktop.org/patch/msgid/20210329175046.214629-2-paul@crapouillou.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8f6dcc4 commit b3f8120

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎drivers/gpu/drm/ingenic/ingenic-drm-drv.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void ingenic_drm_plane_enable(struct ingenic_drm *priv,
347347
unsigned int en_bit;
348348

349349
if (priv->soc_info->has_osd) {
350-
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
350+
if (plane != &priv->f0)
351351
en_bit = JZ_LCD_OSDC_F1EN;
352352
else
353353
en_bit = JZ_LCD_OSDC_F0EN;
@@ -362,7 +362,7 @@ void ingenic_drm_plane_disable(struct device *dev, struct drm_plane *plane)
362362
unsigned int en_bit;
363363

364364
if (priv->soc_info->has_osd) {
365-
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
365+
if (plane != &priv->f0)
366366
en_bit = JZ_LCD_OSDC_F1EN;
367367
else
368368
en_bit = JZ_LCD_OSDC_F0EN;
@@ -389,8 +389,7 @@ void ingenic_drm_plane_config(struct device *dev,
389389

390390
ingenic_drm_plane_enable(priv, plane);
391391

392-
if (priv->soc_info->has_osd &&
393-
plane->type == DRM_PLANE_TYPE_PRIMARY) {
392+
if (priv->soc_info->has_osd && plane != &priv->f0) {
394393
switch (fourcc) {
395394
case DRM_FORMAT_XRGB1555:
396395
ctrl |= JZ_LCD_OSDCTRL_RGB555;
@@ -423,7 +422,7 @@ void ingenic_drm_plane_config(struct device *dev,
423422
}
424423

425424
if (priv->soc_info->has_osd) {
426-
if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
425+
if (plane != &priv->f0) {
427426
xy_reg = JZ_REG_LCD_XYP1;
428427
size_reg = JZ_REG_LCD_SIZE1;
429428
} else {
@@ -455,7 +454,7 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
455454
height = state->src_h >> 16;
456455
cpp = state->fb->format->cpp[0];
457456

458-
if (!priv->soc_info->has_osd || plane->type == DRM_PLANE_TYPE_OVERLAY)
457+
if (!priv->soc_info->has_osd || plane == &priv->f0)
459458
hwdesc = priv->dma_hwdesc_f0;
460459
else
461460
hwdesc = priv->dma_hwdesc_f1;

‎drivers/gpu/drm/ingenic/ingenic-ipu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ static int ingenic_ipu_bind(struct device *dev, struct device *master, void *d)
753753

754754
err = drm_universal_plane_init(drm, plane, 1, &ingenic_ipu_plane_funcs,
755755
soc_info->formats, soc_info->num_formats,
756-
NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
756+
NULL, DRM_PLANE_TYPE_OVERLAY, NULL);
757757
if (err) {
758758
dev_err(dev, "Failed to init plane: %i\n", err);
759759
return err;

0 commit comments

Comments
 (0)