Hi,
This patchset adds support for delta-RGB panels to the ingenic-drm
driver. Delta-RGB panels have diamond-pattern subpixel layout, and
expect odd lines to have RGB subpixel ordering, and even lines to have
GBR subpixel ordering.
Such panel is used in the YLM (aka. Anbernic) RG-99, RG-300, RG-280M
and RG-280V handheld gaming consoles.
Cheers,
-Paul
Paul Cercueil (3):
drm/ingenic: Compute timings according to adjusted_mode->crtc_*
drm/ingenic: Properly compute timings when using a 3x8-bit panel
drm/ingenic: Add support for serial 8-bit delta-RGB panels
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 40 ++++++++++++++++-------
drivers/gpu/drm/ingenic/ingenic-drm.h | 14 ++++++++
2 files changed, 43 insertions(+), 11 deletions(-)
--
2.29.2
The adjusted_mode->crtc_* fields contain the values adjusted for the
hardware, and are the ones that should be written to the registers.
Signed-off-by: Paul Cercueil <[email protected]>
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 368bfef8b340..998c63061fa8 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -190,15 +190,15 @@ static void ingenic_drm_crtc_update_timings(struct ingenic_drm *priv,
{
unsigned int vpe, vds, vde, vt, hpe, hds, hde, ht;
- vpe = mode->vsync_end - mode->vsync_start;
- vds = mode->vtotal - mode->vsync_start;
- vde = vds + mode->vdisplay;
- vt = vde + mode->vsync_start - mode->vdisplay;
+ vpe = mode->crtc_vsync_end - mode->crtc_vsync_start;
+ vds = mode->crtc_vtotal - mode->crtc_vsync_start;
+ vde = vds + mode->crtc_vdisplay;
+ vt = vde + mode->crtc_vsync_start - mode->crtc_vdisplay;
- hpe = mode->hsync_end - mode->hsync_start;
- hds = mode->htotal - mode->hsync_start;
- hde = hds + mode->hdisplay;
- ht = hde + mode->hsync_start - mode->hdisplay;
+ hpe = mode->crtc_hsync_end - mode->crtc_hsync_start;
+ hds = mode->crtc_htotal - mode->crtc_hsync_start;
+ hde = hds + mode->crtc_hdisplay;
+ ht = hde + mode->crtc_hsync_start - mode->crtc_hdisplay;
regmap_write(priv->map, JZ_REG_LCD_VSYNC,
0 << JZ_LCD_VSYNC_VPS_OFFSET |
@@ -333,7 +333,7 @@ static void ingenic_drm_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_pending_vblank_event *event = crtc_state->event;
if (drm_atomic_crtc_needs_modeset(crtc_state)) {
- ingenic_drm_crtc_update_timings(priv, &crtc_state->mode);
+ ingenic_drm_crtc_update_timings(priv, &crtc_state->adjusted_mode);
priv->update_clk_rate = true;
}
--
2.29.2
Hi Paul.
On Thu, Nov 19, 2020 at 03:55:56PM +0000, Paul Cercueil wrote:
> Hi,
>
> This patchset adds support for delta-RGB panels to the ingenic-drm
> driver. Delta-RGB panels have diamond-pattern subpixel layout, and
> expect odd lines to have RGB subpixel ordering, and even lines to have
> GBR subpixel ordering.
>
> Such panel is used in the YLM (aka. Anbernic) RG-99, RG-300, RG-280M
> and RG-280V handheld gaming consoles.
>
> Cheers,
> -Paul
>
> Paul Cercueil (3):
> drm/ingenic: Compute timings according to adjusted_mode->crtc_*
> drm/ingenic: Properly compute timings when using a 3x8-bit panel
> drm/ingenic: Add support for serial 8-bit delta-RGB panels
Strange panel, at least strange bit order.
Patches looks good and are all:
Reviewed-by: Sam Ravnborg <[email protected]>