From patchwork Fri Dec 19 02:00:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5517021 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CFA679F54F for ; Fri, 19 Dec 2014 02:11:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE5E12012E for ; Fri, 19 Dec 2014 02:11:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1BD572011E for ; Fri, 19 Dec 2014 02:11:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C36E86EACA; Thu, 18 Dec 2014 18:11:14 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by gabe.freedesktop.org (Postfix) with ESMTP id E0C826EAC7 for ; Thu, 18 Dec 2014 18:01:08 -0800 (PST) Received: by mail-pd0-f178.google.com with SMTP id r10so163115pdi.9 for ; Thu, 18 Dec 2014 18:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OQ+vK0lPu5fa+0hzxbW0qIxioC9s7zqFO9fKyDWWCQg=; b=hbKaiZh8VSESsvVsz6U5de6mbpKb7iLIjbl9qtRsRIn5tkAIPz0mfxpYH525haGme3 u0JJM22FfZLjCx/EgBbfV4mK1CRMAC7Mm1JnzcNPsZg1ek9cm91UBc06C6/hQjksbzI3 HJ1HDDORTawXv/lzG0rs9GDPq6wXoxYRKOPlSRP/RP88S4i76yoSKHfZ9JlYc0XBs4Fm 1hbq+vAX2mJ9Ak8ZQsfhTk80BG2SYU8AvuumaqUhCWwnUg8ZE2u+yvW97J7eCndhp5z6 IxcRi6b0VeboiRJ8eCcbz8r9J8km/uJKOtmfSY7wJUbCVPVmRbhvuK2+JsGvMuEmVYwd VTZA== X-Received: by 10.70.128.45 with SMTP id nl13mr8359295pdb.126.1418954468650; Thu, 18 Dec 2014 18:01:08 -0800 (PST) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id pd9sm7959386pdb.35.2014.12.18.18.01.07 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 18:01:08 -0800 (PST) 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 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> X-Mailman-Approved-At: Thu, 18 Dec 2014 18:11:13 -0800 Cc: Fabio Estevam , Steve Longerbeam , Denis Carikli , Russell King X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }