Skip to content

Commit 68b433f

Browse files
committed
drm/ingenic: Switch IPU plane to type OVERLAY
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: <[email protected]> # 5.8+ Signed-off-by: Paul Cercueil <[email protected]> Acked-by: Simon Ser <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d176852 commit 68b433f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

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

421421
if (priv->soc_info->has_osd) {
422-
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
422+
if (plane != &priv->f0)
423423
en_bit = JZ_LCD_OSDC_F1EN;
424424
else
425425
en_bit = JZ_LCD_OSDC_F0EN;
@@ -434,7 +434,7 @@ void ingenic_drm_plane_disable(struct device *dev, struct drm_plane *plane)
434434
unsigned int en_bit;
435435

436436
if (priv->soc_info->has_osd) {
437-
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
437+
if (plane != &priv->f0)
438438
en_bit = JZ_LCD_OSDC_F1EN;
439439
else
440440
en_bit = JZ_LCD_OSDC_F0EN;
@@ -461,8 +461,7 @@ void ingenic_drm_plane_config(struct device *dev,
461461

462462
ingenic_drm_plane_enable(priv, plane);
463463

464-
if (priv->soc_info->has_osd &&
465-
plane->type == DRM_PLANE_TYPE_PRIMARY) {
464+
if (priv->soc_info->has_osd && plane != &priv->f0) {
466465
switch (fourcc) {
467466
case DRM_FORMAT_XRGB1555:
468467
ctrl |= JZ_LCD_OSDCTRL_RGB555;
@@ -510,7 +509,7 @@ void ingenic_drm_plane_config(struct device *dev,
510509
}
511510

512511
if (priv->soc_info->has_osd) {
513-
if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
512+
if (plane != &priv->f0) {
514513
xy_reg = JZ_REG_LCD_XYP1;
515514
size_reg = JZ_REG_LCD_SIZE1;
516515
} else {
@@ -561,7 +560,7 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
561560
height = newstate->src_h >> 16;
562561
cpp = newstate->fb->format->cpp[0];
563562

564-
if (!priv->soc_info->has_osd || plane->type == DRM_PLANE_TYPE_OVERLAY)
563+
if (!priv->soc_info->has_osd || plane == &priv->f0)
565564
hwdesc = &priv->dma_hwdescs->hwdesc_f0;
566565
else
567566
hwdesc = &priv->dma_hwdescs->hwdesc_f1;

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

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

768768
err = drm_universal_plane_init(drm, plane, 1, &ingenic_ipu_plane_funcs,
769769
soc_info->formats, soc_info->num_formats,
770-
NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
770+
NULL, DRM_PLANE_TYPE_OVERLAY, NULL);
771771
if (err) {
772772
dev_err(dev, "Failed to init plane: %i\n", err);
773773
return err;

0 commit comments

Comments
 (0)