Merge tag 'du-next-20220707' of git://linuxtv.org/pinchartl/media into drm-next
Miscellaneous R-Car DU fixes and enhancements Signed-off-by: Dave Airlie <airlied@redhat.com> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/YtIEWkE0nk/8nhUc@pendragon.ideasonboard.com
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_cmm.c -- R-Car Display Unit Color Management Module
|
||||
* R-Car Display Unit Color Management Module
|
||||
*
|
||||
* Copyright (C) 2019 Jacopo Mondi <jacopo+renesas@jmondi.org>
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_cmm.h -- R-Car Display Unit Color Management Module
|
||||
* R-Car Display Unit Color Management Module
|
||||
*
|
||||
* Copyright (C) 2019 Jacopo Mondi <jacopo+renesas@jmondi.org>
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_crtc.c -- R-Car Display Unit CRTCs
|
||||
* R-Car Display Unit CRTCs
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
@@ -300,6 +300,11 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc)
|
||||
| DSMR_DIPM_DISP | DSMR_CSPM;
|
||||
rcar_du_crtc_write(rcrtc, DSMR, dsmr);
|
||||
|
||||
/*
|
||||
* When the CMM is enabled, an additional offset of 25 pixels must be
|
||||
* subtracted from the HDS (horizontal display start) and HDE
|
||||
* (horizontal display end) registers.
|
||||
*/
|
||||
hdse_offset = 19;
|
||||
if (rcrtc->group->cmms_mask & BIT(rcrtc->index % 2))
|
||||
hdse_offset += 25;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_crtc.h -- R-Car Display Unit CRTCs
|
||||
* R-Car Display Unit CRTCs
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_drv.c -- R-Car Display Unit DRM driver
|
||||
* R-Car Display Unit DRM driver
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
@@ -55,6 +55,7 @@ static const struct rcar_du_device_info rzg1_du_r8a7743_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rzg1_du_r8a7745_info = {
|
||||
@@ -77,6 +78,7 @@ static const struct rcar_du_device_info rzg1_du_r8a7745_info = {
|
||||
.port = 1,
|
||||
},
|
||||
},
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rzg1_du_r8a77470_info = {
|
||||
@@ -104,6 +106,7 @@ static const struct rcar_du_device_info rzg1_du_r8a77470_info = {
|
||||
.port = 2,
|
||||
},
|
||||
},
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rcar_du_r8a774a1_info = {
|
||||
@@ -133,6 +136,7 @@ static const struct rcar_du_device_info rcar_du_r8a774a1_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
.dpll_mask = BIT(1),
|
||||
};
|
||||
|
||||
@@ -163,6 +167,7 @@ static const struct rcar_du_device_info rcar_du_r8a774b1_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
.dpll_mask = BIT(1),
|
||||
};
|
||||
|
||||
@@ -190,6 +195,7 @@ static const struct rcar_du_device_info rcar_du_r8a774c0_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 2,
|
||||
.num_rpf = 4,
|
||||
.lvds_clk_mask = BIT(1) | BIT(0),
|
||||
};
|
||||
|
||||
@@ -220,6 +226,7 @@ static const struct rcar_du_device_info rcar_du_r8a774e1_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
.dpll_mask = BIT(1),
|
||||
};
|
||||
|
||||
@@ -272,6 +279,7 @@ static const struct rcar_du_device_info rcar_du_r8a7790_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 2,
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
/* M2-W (r8a7791) and M2-N (r8a7793) are identical */
|
||||
@@ -297,6 +305,7 @@ static const struct rcar_du_device_info rcar_du_r8a7791_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rcar_du_r8a7792_info = {
|
||||
@@ -317,6 +326,7 @@ static const struct rcar_du_device_info rcar_du_r8a7792_info = {
|
||||
.port = 1,
|
||||
},
|
||||
},
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rcar_du_r8a7794_info = {
|
||||
@@ -340,6 +350,7 @@ static const struct rcar_du_device_info rcar_du_r8a7794_info = {
|
||||
.port = 1,
|
||||
},
|
||||
},
|
||||
.num_rpf = 4,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rcar_du_r8a7795_info = {
|
||||
@@ -373,6 +384,7 @@ static const struct rcar_du_device_info rcar_du_r8a7795_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
.dpll_mask = BIT(2) | BIT(1),
|
||||
};
|
||||
|
||||
@@ -403,6 +415,7 @@ static const struct rcar_du_device_info rcar_du_r8a7796_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
.dpll_mask = BIT(1),
|
||||
};
|
||||
|
||||
@@ -433,6 +446,7 @@ static const struct rcar_du_device_info rcar_du_r8a77965_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
.dpll_mask = BIT(1),
|
||||
};
|
||||
|
||||
@@ -459,6 +473,7 @@ static const struct rcar_du_device_info rcar_du_r8a77970_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 1,
|
||||
.num_rpf = 5,
|
||||
};
|
||||
|
||||
static const struct rcar_du_device_info rcar_du_r8a7799x_info = {
|
||||
@@ -486,6 +501,7 @@ static const struct rcar_du_device_info rcar_du_r8a7799x_info = {
|
||||
},
|
||||
},
|
||||
.num_lvds = 2,
|
||||
.num_rpf = 5,
|
||||
.lvds_clk_mask = BIT(1) | BIT(0),
|
||||
};
|
||||
|
||||
@@ -505,6 +521,7 @@ static const struct rcar_du_device_info rcar_du_r8a779a0_info = {
|
||||
.port = 1,
|
||||
},
|
||||
},
|
||||
.num_rpf = 5,
|
||||
.dsi_clk_mask = BIT(1) | BIT(0),
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_drv.h -- R-Car Display Unit DRM driver
|
||||
* R-Car Display Unit DRM driver
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
@@ -69,6 +69,7 @@ struct rcar_du_output_routing {
|
||||
* @channels_mask: bit mask of available DU channels
|
||||
* @routes: array of CRTC to output routes, indexed by output (RCAR_DU_OUTPUT_*)
|
||||
* @num_lvds: number of internal LVDS encoders
|
||||
* @num_rpf: number of RPFs in VSP
|
||||
* @dpll_mask: bit mask of DU channels equipped with a DPLL
|
||||
* @dsi_clk_mask: bitmask of channels that can use the DSI clock as dot clock
|
||||
* @lvds_clk_mask: bitmask of channels that can use the LVDS clock as dot clock
|
||||
@@ -80,6 +81,7 @@ struct rcar_du_device_info {
|
||||
unsigned int channels_mask;
|
||||
struct rcar_du_output_routing routes[RCAR_DU_OUTPUT_MAX];
|
||||
unsigned int num_lvds;
|
||||
unsigned int num_rpf;
|
||||
unsigned int dpll_mask;
|
||||
unsigned int dsi_clk_mask;
|
||||
unsigned int lvds_clk_mask;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_encoder.c -- R-Car Display Unit Encoder
|
||||
* R-Car Display Unit Encoder
|
||||
*
|
||||
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_encoder.h -- R-Car Display Unit Encoder
|
||||
* R-Car Display Unit Encoder
|
||||
*
|
||||
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_group.c -- R-Car Display Unit Channels Pair
|
||||
* R-Car Display Unit Channels Pair
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_group.c -- R-Car Display Unit Planes and CRTCs Group
|
||||
* R-Car Display Unit Planes and CRTCs Group
|
||||
*
|
||||
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_kms.c -- R-Car Display Unit Mode Setting
|
||||
* R-Car Display Unit Mode Setting
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_kms.h -- R-Car Display Unit Mode Setting
|
||||
* R-Car Display Unit Mode Setting
|
||||
*
|
||||
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_plane.c -- R-Car Display Unit Planes
|
||||
* R-Car Display Unit Planes
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
@@ -512,6 +512,18 @@ static void rcar_du_plane_setup_format_gen3(struct rcar_du_group *rgrp,
|
||||
|
||||
rcar_du_plane_write(rgrp, index, PnDDCR4,
|
||||
state->format->edf | PnDDCR4_CODE);
|
||||
|
||||
/*
|
||||
* On Gen3, some DU channels have two planes, each being wired to a
|
||||
* separate VSPD instance. The DU can then blend two planes. While
|
||||
* this feature isn't used by the driver, issues related to alpha
|
||||
* blending (such as incorrect colors or planes being invisible) may
|
||||
* still occur if the PnALPHAR register has a stale value. Set the
|
||||
* register to 0 to avoid this.
|
||||
*/
|
||||
|
||||
/* TODO: Check if alpha-blending should be disabled in PnMR. */
|
||||
rcar_du_plane_write(rgrp, index, PnALPHAR, 0);
|
||||
}
|
||||
|
||||
static void rcar_du_plane_setup_format(struct rcar_du_group *rgrp,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_plane.h -- R-Car Display Unit Planes
|
||||
* R-Car Display Unit Planes
|
||||
*
|
||||
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* rcar_du_regs.h -- R-Car Display Unit Registers Definitions
|
||||
* R-Car Display Unit Registers Definitions
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* rcar_du_vsp.h -- R-Car Display Unit VSP-Based Compositor
|
||||
* R-Car Display Unit VSP-Based Compositor
|
||||
*
|
||||
* Copyright (C) 2015 Renesas Electronics Corporation
|
||||
*
|
||||
@@ -407,11 +407,7 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* The VSP2D (Gen3) has 5 RPFs, but the VSP1D (Gen2) is limited to
|
||||
* 4 RPFs.
|
||||
*/
|
||||
num_planes = rcdu->info->gen >= 3 ? 5 : 4;
|
||||
num_planes = rcdu->info->num_rpf;
|
||||
|
||||
vsp->planes = kcalloc(num_planes, sizeof(*vsp->planes), GFP_KERNEL);
|
||||
if (!vsp->planes)
|
||||
@@ -437,14 +433,9 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
|
||||
drm_plane_helper_add(&plane->plane,
|
||||
&rcar_du_vsp_plane_helper_funcs);
|
||||
|
||||
if (type == DRM_PLANE_TYPE_PRIMARY) {
|
||||
drm_plane_create_zpos_immutable_property(&plane->plane,
|
||||
0);
|
||||
} else {
|
||||
drm_plane_create_alpha_property(&plane->plane);
|
||||
drm_plane_create_zpos_property(&plane->plane, 1, 1,
|
||||
num_planes - 1);
|
||||
}
|
||||
drm_plane_create_alpha_property(&plane->plane);
|
||||
drm_plane_create_zpos_property(&plane->plane, i, 0,
|
||||
num_planes - 1);
|
||||
|
||||
vsp->num_planes++;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_vsp.h -- R-Car Display Unit VSP-Based Compositor
|
||||
* R-Car Display Unit VSP-Based Compositor
|
||||
*
|
||||
* Copyright (C) 2015 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* rcar_du_writeback.c -- R-Car Display Unit Writeback Support
|
||||
* R-Car Display Unit Writeback Support
|
||||
*
|
||||
* Copyright (C) 2019 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* rcar_du_writeback.h -- R-Car Display Unit Writeback Support
|
||||
* R-Car Display Unit Writeback Support
|
||||
*
|
||||
* Copyright (C) 2019 Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* rcar_lvds.c -- R-Car LVDS Encoder
|
||||
* R-Car LVDS Encoder
|
||||
*
|
||||
* Copyright (C) 2013-2018 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* rcar_lvds.h -- R-Car LVDS Encoder
|
||||
* R-Car LVDS Encoder
|
||||
*
|
||||
* Copyright (C) 2013-2018 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* rcar_lvds_regs.h -- R-Car LVDS Interface Registers Definitions
|
||||
* R-Car LVDS Interface Registers Definitions
|
||||
*
|
||||
* Copyright (C) 2013-2015 Renesas Electronics Corporation
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* rcar_mipi_dsi.c -- R-Car MIPI DSI Encoder
|
||||
* R-Car MIPI DSI Encoder
|
||||
*
|
||||
* Copyright (C) 2020 Renesas Electronics Corporation
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* rcar_mipi_dsi_regs.h -- R-Car MIPI DSI Interface Registers Definitions
|
||||
* R-Car MIPI DSI Interface Registers Definitions
|
||||
*
|
||||
* Copyright (C) 2020 Renesas Electronics Corporation
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user