From patchwork Wed Oct 16 19:26:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3057491 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 A83A39F243 for ; Wed, 16 Oct 2013 20:55:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB970204AD for ; Wed, 16 Oct 2013 20:55:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E11E72047C for ; Wed, 16 Oct 2013 20:55:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D325FE76AE for ; Wed, 16 Oct 2013 13:55:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f175.google.com (mail-qc0-f175.google.com [209.85.216.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 79AC0E7821 for ; Wed, 16 Oct 2013 12:27:34 -0700 (PDT) Received: by mail-qc0-f175.google.com with SMTP id v2so1014525qcr.20 for ; Wed, 16 Oct 2013 12:27:34 -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=N9YgTRVmZTepxhKHguvvAH7IbLqsspJrPwc0TEUlOCI=; b=LmNJAKpZHaPOf7Acqt9PbVb2/WZgLXfOWjwhFU50W2zbISBDX/C4gIg0DeYVae0qLt T7LFN0xrcwXmc3ZtN/UwKo0tzWMHyp3btX+RWFpTJ4TRhyNH29FJiBL8pPipeuV79TTB dDi7LLNSLs1MFdeP564dt11DFDL7p7dhR5PM0= 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=N9YgTRVmZTepxhKHguvvAH7IbLqsspJrPwc0TEUlOCI=; b=Ty+5LZ5eXSToiiaoEEouh1Ifm9XLv89EDj+UbdOHhWveFWK3wajmdvFMnQDBUQTs4l QZ0FomcIdOr7QCx0O5YvbDPu3q/0UM716Y5DbdyluQjH+X5KsdmDuMwQ+bWt4hfPmPq5 8DZUEmy8Y12KpFoa/vbAOlDpWtKAJLBPk0Z8LLxJikBbJZymDkFgaqC+KN4KKby45rds JGNuC2XFEPbllZkip2ddNaWyx/PvTkG+3XTbwTdFcIq5Z5JA9+pTH5MNYG8RPC/C9CFn 5igtvy5bdLEQHhCdThTrsK3URSUCRyTRBwd5y1XNr9oDX07W9Ucy5cyLvs+XjKwUSzqG vkAw== X-Gm-Message-State: ALoCoQm2+wHcxZV2y/7tAiwR1b2avry6n5w9ywWEmo9oeiUG5QbYQQDVUuOyhOv9/NsVvIIS2r+U X-Received: by 10.49.0.208 with SMTP id 16mr6282142qeg.25.1381951654137; Wed, 16 Oct 2013 12:27:34 -0700 (PDT) Received: from seanpaul-glaptop.roam.corp.google.com (cpe-173-095-180-236.nc.res.rr.com. [173.95.180.236]) by mx.google.com with ESMTPSA id 4sm167771575qak.11.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 12:27:33 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v2 18/26] drm/exynos: Implement mode_fixup manager operation Date: Wed, 16 Oct 2013 15:26:48 -0400 Message-Id: <1381951616-12548-19-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1381951616-12548-1-git-send-email-seanpaul@chromium.org> References: <1381951616-12548-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.6 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 --- Changes in v2: None drivers/gpu/drm/exynos/exynos_drm_crtc.c | 7 ++++++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 ++++ 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 a5cb104..100a561 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -105,7 +105,12 @@ 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, 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 c58a4c7..97bdfcc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -184,6 +184,7 @@ struct exynos_drm_display { * @initialize: initializes the manager with drm_dev * @remove: cleans up the manager for removal * @dpms: control device power. + * @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. @@ -201,6 +202,9 @@ struct exynos_drm_manager_ops { struct drm_device *drm_dev, int pipe); void (*remove)(struct exynos_drm_manager *mgr); void (*dpms)(struct exynos_drm_manager *mgr, int mode); + bool (*mode_fixup)(struct exynos_drm_manager *mgr, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode); void (*mode_set)(struct exynos_drm_manager *mgr, const struct drm_display_mode *mode); void (*commit)(struct exynos_drm_manager *mgr);