From patchwork Thu Jan 30 21:19:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3559301 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 0C0899F382 for ; Thu, 30 Jan 2014 21:21:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2677F20173 for ; Thu, 30 Jan 2014 21:21:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 470BA201B9 for ; Thu, 30 Jan 2014 21:21:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 490B444495; Thu, 30 Jan 2014 13:20:59 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f179.google.com (mail-qc0-f179.google.com [209.85.216.179]) by gabe.freedesktop.org (Postfix) with ESMTP id 718C5441C5 for ; Thu, 30 Jan 2014 13:20:33 -0800 (PST) Received: by mail-qc0-f179.google.com with SMTP id e16so5825923qcx.24 for ; Thu, 30 Jan 2014 13:20:33 -0800 (PST) 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=fEZ4hFY8ioyqj4TikN2cCDKQkV9IxLThm/34QiS8fJk=; b=AtyXgCb5ev5lqvPI9Qg86+ENqibXgeczBTR+dE497EPNQMob6LrNqX6oRjO8OsT8Kx gXkgBKmEhZTP0wg+qqtjoMgDjsHrBquZptq//zwhBPTj+AETOTpNLakt3N3MDxTzZnfd VdDXWWdYFBtGvf3Iy26OX63mdUExvriNvsX7U= 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=fEZ4hFY8ioyqj4TikN2cCDKQkV9IxLThm/34QiS8fJk=; b=aD2IkkS9D/wZhQvaZPkWE8F/ov3FD5jC2wa+zV/yYfRoMasDgYG/LLCIhzfz0OfWL/ GIDVWe+Dz+Eq9EuAWREkkbpkP/uxhd1r2DMVOJroaza/G9eIDRegvGviCP3KUIgbfkho n0Jr/R4Jyc5mIVSspl6po4VRwQKjMZZmoeap8b65R0Dg/UC/Iffjd5kwU98UeUKTICcF VNj8wrKb7sA3AHPFrcP8eF3K6ylMko2F8qFPDflY5xZ1r4KSfA89zL5nN8E4e3WFTz2P 9nDuCZkMVtAI0Zvmy9xu4Ier2Hw9DH+WencdC3UN0E91BaChrsW2L8+dFmCd3Z4z+Euz fH3w== X-Gm-Message-State: ALoCoQndBDsVm7LbD8BGVqsGkjUofdLpKmLb2/2+m5I/qP4/xRlZGiacPiV2+Rj7JeRLynLQ47KF X-Received: by 10.224.137.66 with SMTP id v2mr25596676qat.104.1391116821909; Thu, 30 Jan 2014 13:20:21 -0800 (PST) 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 r13sm20673608qan.7.2014.01.30.13.20.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Jan 2014 13:20:19 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v4 19/34] drm/exynos: Add mode_set manager operation Date: Thu, 30 Jan 2014 16:19:18 -0500 Message-Id: <1391116773-28471-20-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1391116773-28471-1-git-send-email-seanpaul@chromium.org> References: <1391116773-28471-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.5 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 mode_set callback to the manager operations which sets the crtc's current mode to the manager driver. This will allow the fimd driver to set its mode using values from drm, instead of the dt. Signed-off-by: Sean Paul --- Changes in v2: None Changes in v3: None Changes in v4: - Added a bit more explanation to commit msg drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 ++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index d019385..a5cb104 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -115,6 +115,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_framebuffer *old_fb) { struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); + struct exynos_drm_manager *manager = exynos_crtc->manager; struct drm_plane *plane = exynos_crtc->plane; unsigned int crtc_w; unsigned int crtc_h; @@ -129,6 +130,9 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, crtc_w = crtc->fb->width - x; crtc_h = crtc->fb->height - y; + if (manager->ops->mode_set) + manager->ops->mode_set(manager, &crtc->mode); + ret = exynos_plane_mode_set(plane, crtc, crtc->fb, 0, 0, crtc_w, crtc_h, x, y, crtc_w, crtc_h); if (ret) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 4f03242..caba299 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_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. * @disable_vblank: specific driver callback for disabling vblank interrupt. @@ -200,6 +201,8 @@ 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); + void (*mode_set)(struct exynos_drm_manager *mgr, + const struct drm_display_mode *mode); void (*commit)(struct exynos_drm_manager *mgr); int (*enable_vblank)(struct exynos_drm_manager *mgr); void (*disable_vblank)(struct exynos_drm_manager *mgr);