From patchwork Tue Oct 29 16:13:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3109171 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 291B8BF924 for ; Tue, 29 Oct 2013 16:18:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0806F20304 for ; Tue, 29 Oct 2013 16:18:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6F293200F4 for ; Tue, 29 Oct 2013 16:18:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE09EEEC09; Tue, 29 Oct 2013 09:15:08 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f52.google.com (mail-qa0-f52.google.com [209.85.216.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 74001EEBDE for ; Tue, 29 Oct 2013 09:14:02 -0700 (PDT) Received: by mail-qa0-f52.google.com with SMTP id w8so147892qac.18 for ; Tue, 29 Oct 2013 09:14:02 -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=5Cazjyo19WUkR43kdBqTAkPNPr/JNOmm/A4uy7c5TF4=; b=N7dX3bupFgPA2UYIzsxUOZAnUBPWz3UY2CK4I2LU2WaR6Dci7kmvY0owVc3o3p8Add 01S3hebsrrg4sJo4xggrZd9/yVn43gDDN3w+Gud/eI/yy3DNZoluBwZPcUR7Wh6mtHHx YqtikX3KxrLycOBnYliqaYvkAROY/b72OkKqY= 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=5Cazjyo19WUkR43kdBqTAkPNPr/JNOmm/A4uy7c5TF4=; b=jT4mmeZqJ9MoyPxF+rac8o/JyhcR498FWIFMWxxqaeNjyUOBf9dbFLRVvhlOUocauE x5viA4gSfPS2O63bvFmyzLafqZ7+mtARR+tOuiBK/5Q748imD0ekzqOCyeqGDfL5tptU +P8PZE6wlOrv9Ip1EkPwegLiwb7ZUcN3eQE7QzkYwOmhstm52v02UeKu2AJOo+eIN/OV JIN9oULL8uEcg+Abj1z6747w/PWxfDlgPmefWpWzckbdCAtN5BijHXgas7PqV8W/knQv oVqsUZC4ZtwhLYRlX2Qp+vhyDTu0CvzwIIEuJxqGWywUflrWuIjAOhCbRpWYvc/ukQvh o5sg== X-Gm-Message-State: ALoCoQngk4JY09vNMZvBPFHztX28tdfb8ym4nNLl2IcSz4smhzgdIhZjFJvsnfg6AenvvxdxaN7Z X-Received: by 10.229.13.69 with SMTP id b5mr603339qca.13.1383063241943; Tue, 29 Oct 2013 09:14:01 -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 h9sm66581946qaq.9.2013.10.29.09.14.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 09:14:01 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v3 18/32] drm/exynos: Implement mode_fixup manager operation Date: Tue, 29 Oct 2013 12:13:04 -0400 Message-Id: <1383063198-10526-19-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1383063198-10526-1-git-send-email-seanpaul@chromium.org> References: <1383063198-10526-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@lists.freedesktop.org Errors-To: dri-devel-bounces@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 Changes in v3: 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);