Skip to content

Commit

Permalink
imx-drm: ipuv3-crtc: Implement mode_fixup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve Longerbeam authored and Philipp Zabel committed Jan 7, 2015
1 parent d490f45 commit 0c460a5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/gpu/drm/imx/ipuv3-crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ static bool ipu_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
struct videomode vm;
int ret;

drm_display_mode_to_videomode(adjusted_mode, &vm);

ret = ipu_di_adjust_videomode(ipu_crtc->di, &vm);
if (ret)
return false;

drm_display_mode_from_videomode(&vm, adjusted_mode);

return true;
}

Expand Down

0 comments on commit 0c460a5

Please sign in to comment.