aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx/ipuv3-crtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/imx/ipuv3-crtc.c')
-rw-r--r--drivers/gpu/drm/imx/ipuv3-crtc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 98551e356e12..7bc8301fafff 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -45,7 +45,7 @@ struct ipu_crtc {
45 struct drm_pending_vblank_event *page_flip_event; 45 struct drm_pending_vblank_event *page_flip_event;
46 struct drm_framebuffer *newfb; 46 struct drm_framebuffer *newfb;
47 int irq; 47 int irq;
48 u32 interface_pix_fmt; 48 u32 bus_format;
49 int di_hsync_pin; 49 int di_hsync_pin;
50 int di_vsync_pin; 50 int di_vsync_pin;
51}; 51};
@@ -145,7 +145,6 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
145 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); 145 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
146 struct ipu_di_signal_cfg sig_cfg = {}; 146 struct ipu_di_signal_cfg sig_cfg = {};
147 unsigned long encoder_types = 0; 147 unsigned long encoder_types = 0;
148 u32 out_pixel_fmt;
149 int ret; 148 int ret;
150 149
151 dev_dbg(ipu_crtc->dev, "%s: mode->hdisplay: %d\n", __func__, 150 dev_dbg(ipu_crtc->dev, "%s: mode->hdisplay: %d\n", __func__,
@@ -161,21 +160,21 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
161 __func__, encoder_types); 160 __func__, encoder_types);
162 161
163 /* 162 /*
164 * If we have DAC, TVDAC or LDB, then we need the IPU DI clock 163 * If we have DAC or LDB, then we need the IPU DI clock to be
165 * to be the same as the LDB DI clock. 164 * the same as the LDB DI clock. For TVDAC, derive the IPU DI
165 * clock from 27 MHz TVE_DI clock, but allow to divide it.
166 */ 166 */
167 if (encoder_types & (BIT(DRM_MODE_ENCODER_DAC) | 167 if (encoder_types & (BIT(DRM_MODE_ENCODER_DAC) |
168 BIT(DRM_MODE_ENCODER_TVDAC) |
169 BIT(DRM_MODE_ENCODER_LVDS))) 168 BIT(DRM_MODE_ENCODER_LVDS)))
170 sig_cfg.clkflags = IPU_DI_CLKMODE_SYNC | IPU_DI_CLKMODE_EXT; 169 sig_cfg.clkflags = IPU_DI_CLKMODE_SYNC | IPU_DI_CLKMODE_EXT;
170 else if (encoder_types & BIT(DRM_MODE_ENCODER_TVDAC))
171 sig_cfg.clkflags = IPU_DI_CLKMODE_EXT;
171 else 172 else
172 sig_cfg.clkflags = 0; 173 sig_cfg.clkflags = 0;
173 174
174 out_pixel_fmt = ipu_crtc->interface_pix_fmt;
175
176 sig_cfg.enable_pol = 1; 175 sig_cfg.enable_pol = 1;
177 sig_cfg.clk_pol = 0; 176 sig_cfg.clk_pol = 0;
178 sig_cfg.pixel_fmt = out_pixel_fmt; 177 sig_cfg.bus_format = ipu_crtc->bus_format;
179 sig_cfg.v_to_h_sync = 0; 178 sig_cfg.v_to_h_sync = 0;
180 sig_cfg.hsync_pin = ipu_crtc->di_hsync_pin; 179 sig_cfg.hsync_pin = ipu_crtc->di_hsync_pin;
181 sig_cfg.vsync_pin = ipu_crtc->di_vsync_pin; 180 sig_cfg.vsync_pin = ipu_crtc->di_vsync_pin;
@@ -184,7 +183,7 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
184 183
185 ret = ipu_dc_init_sync(ipu_crtc->dc, ipu_crtc->di, 184 ret = ipu_dc_init_sync(ipu_crtc->dc, ipu_crtc->di,
186 mode->flags & DRM_MODE_FLAG_INTERLACE, 185 mode->flags & DRM_MODE_FLAG_INTERLACE,
187 out_pixel_fmt, mode->hdisplay); 186 ipu_crtc->bus_format, mode->hdisplay);
188 if (ret) { 187 if (ret) {
189 dev_err(ipu_crtc->dev, 188 dev_err(ipu_crtc->dev,
190 "initializing display controller failed with %d\n", 189 "initializing display controller failed with %d\n",
@@ -202,7 +201,8 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
202 return ipu_plane_mode_set(ipu_crtc->plane[0], crtc, mode, 201 return ipu_plane_mode_set(ipu_crtc->plane[0], crtc, mode,
203 crtc->primary->fb, 202 crtc->primary->fb,
204 0, 0, mode->hdisplay, mode->vdisplay, 203 0, 0, mode->hdisplay, mode->vdisplay,
205 x, y, mode->hdisplay, mode->vdisplay); 204 x, y, mode->hdisplay, mode->vdisplay,
205 mode->flags & DRM_MODE_FLAG_INTERLACE);
206} 206}
207 207
208static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc) 208static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc)
@@ -291,11 +291,11 @@ static void ipu_disable_vblank(struct drm_crtc *crtc)
291} 291}
292 292
293static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc, 293static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc,
294 u32 pixfmt, int hsync_pin, int vsync_pin) 294 u32 bus_format, int hsync_pin, int vsync_pin)
295{ 295{
296 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); 296 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
297 297
298 ipu_crtc->interface_pix_fmt = pixfmt; 298 ipu_crtc->bus_format = bus_format;
299 ipu_crtc->di_hsync_pin = hsync_pin; 299 ipu_crtc->di_hsync_pin = hsync_pin;
300 ipu_crtc->di_vsync_pin = vsync_pin; 300 ipu_crtc->di_vsync_pin = vsync_pin;
301 301