drm: tilcdc: Evaluate pixelclk-active property from display-timings
Subsystems (3)
The pixel clock "polarity" is set for tilcdc panels with the invert-pxl-clk property. But if we have several display-timings with different pixel clock setups we need to set the values depending on the selected display-timing. Check for the pixelclk-active property and invert the value if invert-pxl-clk is set. The pixelclk-active is not included in the drm_display_mode and has to be taken from the drm bus flags.
Signed-off-by Teresa Remmet <[email protected]>
---
This is probably not the right way to go. As I just took some unused private flag to pass the bus flags. I appreciate a hint to the right direction.
Regards,
Teresa
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 13 ++++++++++++- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 1 + 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +12 -1
@@ -305,6 +305,7 @@ static void tilcdc_crtc_mode_set_nofb(struct drm_crtc *crtc)uint32_t reg, hbp, hfp, hsw, vbp, vfp, vsw;struct drm_display_mode *mode = &crtc->state->adjusted_mode;struct drm_framebuffer *fb = crtc->primary->state->fb; +bool invert_pxlclk =0 ;if (WARN_ON (!info))return ;
@@ -424,7 +425,17 @@ static void tilcdc_crtc_mode_set_nofb(struct drm_crtc *crtc) reg |= info->fdd <12 ;tilcdc_write (dev,LCDC_RASTER_CTRL_REG , reg); -if (info->invert_pxl_clk) +/* The invert_pxl_clk property sets up the pixel clock for all available +* display-timings. But in some cases a per display-timing pixel clock +* setup is needed. Check the "pixelclk-active" property and invert this +* value if invert_pxl_clk is set. +*/ +if (mode->private_flags &DRM_BUS_FLAG_PIXDATA_POSEDGE ) + invert_pxlclk =1 ; + + invert_pxlclk = (info->invert_pxl_clk ? !invert_pxlclk : invert_pxlclk); + +if (invert_pxlclk)tilcdc_set (dev,LCDC_RASTER_TIMING_2_REG ,LCDC_INVERT_PIXEL_CLOCK );else tilcdc_clear (dev,LCDC_RASTER_TIMING_2_REG ,LCDC_INVERT_PIXEL_CLOCK );
drivers/gpu/drm/tilcdc/tilcdc_panel.c +1 -0
@@ -165,6 +165,7 @@ static int panel_connector_get_modes(struct drm_connector *connector)break ;drm_display_mode_from_videomode (&vm, mode); +drm_bus_flags_from_videomode (&vm, &(mode->private_flags)); mode->type =DRM_MODE_TYPE_DRIVER ;
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel