From patchwork Tue Dec 16 00:29:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5499031 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EE2E5BEEBA for ; Tue, 16 Dec 2014 01:08:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38C7A209C9 for ; Tue, 16 Dec 2014 01:08:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5461D209D3 for ; Tue, 16 Dec 2014 01:08:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E71E06E2C5; Mon, 15 Dec 2014 17:08:30 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 61F646E66E for ; Mon, 15 Dec 2014 16:31:13 -0800 (PST) Received: by mail-pd0-f174.google.com with SMTP id fp1so12612881pdb.5 for ; Mon, 15 Dec 2014 16:31:13 -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=+dGGBxb/eN14qIvmWXp8aoQTY4T5A1eE68PDq2+CEAw=; b=pv1scF0WXODrrI0UfBS7psNkQc7MVnHXVsnN0Xrr0eJFcEpHDjVh9gjqHLmlwJ8g6P s53cYQF1aFZDWkPlWpHeYB4fiHqxCn8ZbS1c50F3fsFWin3GmB/rISzFijpDByZJTVAs dN4U+CWuHG2AP4PnkWtSlXHYlZnR9qcjTSn6whMLjhoPBsx+f8ukwNAoQPEVz8cd5tCu AjNVzZ+73Bvzuu7xhcd1vq0sVLXBFy8ZG4BUHPmDvOr7Legz9gYVkx6yAEsNKcabVcWZ eKF+V/k/8ZY/kixqLViTmMzXjKov7ZeDxBN+lV8gXPqItoJp7tXSe+D7F23HKyuDUV0P K1Uw== X-Received: by 10.70.41.2 with SMTP id b2mr26921694pdl.62.1418689873126; Mon, 15 Dec 2014 16:31:13 -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 bq7sm10393786pdb.50.2014.12.15.16.31.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 16:31:12 -0800 (PST) From: slongerbeam@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/6] imx-drm: ipuv3-crtc: Implement mode_fixup Date: Mon, 15 Dec 2014 16:29:22 -0800 Message-Id: <1418689764-11276-5-git-send-email-slongerbeam@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1418689764-11276-1-git-send-email-slongerbeam@gmail.com> References: <1418689764-11276-1-git-send-email-slongerbeam@gmail.com> X-Mailman-Approved-At: Mon, 15 Dec 2014 17:08:29 -0800 Cc: Steve Longerbeam 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 From: Steve Longerbeam 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; }