diff options
| author | Steve Longerbeam <slongerbeam@gmail.com> | 2014-12-18 21:00:23 -0500 |
|---|---|---|
| committer | Philipp Zabel <p.zabel@pengutronix.de> | 2015-01-07 13:15:02 -0500 |
| commit | 0c460a55dd97b639202d6152979669c8951522cd (patch) | |
| tree | deb17aa619a2700c55290c448e69662c7b63db72 /drivers/gpu/drm/imx | |
| parent | d490f455f4ac3d97fbf109deae1e017b26acffda (diff) | |
imx-drm: ipuv3-crtc: Implement mode_fixup
Ask the IPU display interface, via ipu_di_adjust_videomode(), to
adjust a video mode to meet any DI restrictions. The function takes
a subsystem independent videomode, so the drm_display_mode must be
converted to videomode first, and then the adjusted mode converted
back to a drm_display_mode.
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/imx')
| -rw-r--r-- | drivers/gpu/drm/imx/ipuv3-crtc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index ebee59cb96d8..23d69ecb62dd 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c | |||
| @@ -237,6 +237,18 @@ static bool ipu_crtc_mode_fixup(struct drm_crtc *crtc, | |||
| 237 | const struct drm_display_mode *mode, | 237 | const struct drm_display_mode *mode, |
| 238 | struct drm_display_mode *adjusted_mode) | 238 | struct drm_display_mode *adjusted_mode) |
| 239 | { | 239 | { |
| 240 | struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); | ||
| 241 | struct videomode vm; | ||
| 242 | int ret; | ||
| 243 | |||
| 244 | drm_display_mode_to_videomode(adjusted_mode, &vm); | ||
| 245 | |||
| 246 | ret = ipu_di_adjust_videomode(ipu_crtc->di, &vm); | ||
| 247 | if (ret) | ||
| 248 | return false; | ||
| 249 | |||
| 250 | drm_display_mode_from_videomode(&vm, adjusted_mode); | ||
| 251 | |||
| 240 | return true; | 252 | return true; |
| 241 | } | 253 | } |
| 242 | 254 | ||
