From patchwork Fri Oct 11 00:30:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3020001 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 64A35BF924 for ; Fri, 11 Oct 2013 00:52:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 837B020266 for ; Fri, 11 Oct 2013 00:52:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B0BC120254 for ; Fri, 11 Oct 2013 00:52:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B0979E7B96 for ; Thu, 10 Oct 2013 17:52:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ie0-f176.google.com (mail-ie0-f176.google.com [209.85.223.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F07DE767B for ; Thu, 10 Oct 2013 17:31:21 -0700 (PDT) Received: by mail-ie0-f176.google.com with SMTP id ar20so6538175iec.21 for ; Thu, 10 Oct 2013 17:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J3N4cTFlQ80MC7Jeo0p/aEBPc/BduEJv6KS5GiEv+28=; b=bWxXBP+hzrS79+QsYmbW87BvyWhVRJB88EIXFBmeQuKkti41E7v1u8S9UCrPxEBggF 0ihO7safoTHfx6Fhmr1z8xfh0LkJcPPCTq3xDRGM9sruF1YE/p7/tGMfoDnxI0e/Wmnb jPe3mgJ+qkg+cgnDJCiDKchwUn6sEGBKSushA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J3N4cTFlQ80MC7Jeo0p/aEBPc/BduEJv6KS5GiEv+28=; b=O8UVCE+bzUTnWH9IHXsvdNGvBwxDazhsXDk4OSBMc+JC58Z4vJQoMHPqjFNNjG0K+D A33XsaBJDojXz/MupLBXJ3z2VphEti1Lw8jvh2oUiwHEtdBg3bByVG33+I+jf0g1PIaC 65AuTsQUovfj3hG6G6oJJnC3oMzhDsPjyPCzSxyhXUNDV0yaLviqsK/F0puOvnu+6P7W J6U+l/TAUGXI3p6u8Iw88+irOYrLzZHygR4aic0a+0Jz1WrsSWu+CvsrSyAVDADNcAfx D5bSS/vyyEgSYowcg+fd22a9LWnKsVNwIrQpoJ9JRFZPlTDotf66ZCDAW3sNRaPK+u6l 5nfQ== X-Gm-Message-State: ALoCoQkZA4MbkIRf9ke4ESBFUYxh8Whb1+D/Jhf6HNLbGalo/YD9l/7azOI/z2zBtKsU+pjpGeJW X-Received: by 10.50.153.16 with SMTP id vc16mr761893igb.8.1381451480806; Thu, 10 Oct 2013 17:31:20 -0700 (PDT) Received: from seanpaul-glaptop.corp.google.com (dhcp-172-19-29-233.mtv.corp.google.com [172.19.29.233]) by mx.google.com with ESMTPSA id p7sm420421iga.3.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 17:31:20 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH 18/23] drm/exynos: Implement mode_fixup manager operation Date: Thu, 10 Oct 2013 20:30:31 -0400 Message-Id: <1381451436-10089-19-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1381451436-10089-1-git-send-email-seanpaul@chromium.org> References: <1381451436-10089-1-git-send-email-seanpaul@chromium.org> Cc: marcheu@chromium.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 This patch adds a new manager callback for mode_fixup and pipes it through exynos_drm_crtc. Signed-off-by: Sean Paul --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 8 +++++++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 576754d..083e1e3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -105,7 +105,13 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { - /* drm framework doesn't check NULL */ + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); + struct exynos_drm_manager *manager = exynos_crtc->manager; + + if (manager->ops->mode_fixup) + return manager->ops->mode_fixup(manager->ctx, mode, + adjusted_mode); + return true; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 3a86473..0a956d0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -178,6 +178,7 @@ struct exynos_drm_display { * @remove: cleans up the manager for removal * @dpms: control device power. * @apply: set timing, vblank and overlay data to registers. + * @mode_fixup: fix mode data before applying it * @mode_set: set the given mode to the manager * @commit: set current hw specific display mode to hw. * @enable_vblank: specific driver callback for enabling vblank interrupt. @@ -194,6 +195,8 @@ struct exynos_drm_manager_ops { void (*remove)(void *ctx); void (*dpms)(void *ctx, int mode); void (*apply)(void *ctx); + bool (*mode_fixup)(void *ctx, const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode); void (*mode_set)(void *ctx, const struct drm_display_mode *mode); void (*commit)(void *ctx); int (*enable_vblank)(void *ctx);