Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286AbaLSCCu (ORCPT ); Thu, 18 Dec 2014 21:02:50 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:46745 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbaLSCBJ (ORCPT ); Thu, 18 Dec 2014 21:01:09 -0500 From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, David Airlie , Philipp Zabel , Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: Russell King , Fabio Estevam , Shawn Guo , Denis Carikli , Jiada Wang , Steve Longerbeam Subject: [PATCH v2 4/7] imx-drm: ipuv3-crtc: Implement mode_fixup Date: Thu, 18 Dec 2014 18:00:23 -0800 Message-Id: <1418954426-21909-5-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1418954426-21909-1-git-send-email-steve_longerbeam@mentor.com> References: <1418954426-21909-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/imx/ipuv3-crtc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 11e84a2..fb16026 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -242,6 +242,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; + + videomode_from_drm_display_mode(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; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/