From patchwork Wed Oct 16 19:26:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3057291 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 1839C9F2B7 for ; Wed, 16 Oct 2013 20:37:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57D91201F9 for ; Wed, 16 Oct 2013 20:37:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2E6AD204AD for ; Wed, 16 Oct 2013 20:37:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5259DE7719 for ; Wed, 16 Oct 2013 13:37:42 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com [209.85.216.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BBC5E776D for ; Wed, 16 Oct 2013 12:27:16 -0700 (PDT) Received: by mail-qa0-f44.google.com with SMTP id cm18so4812975qab.3 for ; Wed, 16 Oct 2013 12:27:15 -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=oPZlDpHAx9Ht925QqCXy+irbQ1RALfaKvufqfu4S91c=; b=E37lQ4yQKVFZ0FtCT1qT2jRHASe2eRqJ92dy/OqzrPtlwKWtVUQjTUqshlv+s82PsR di/wqgjnskteeU3Cv+PhSDBo8lTdCk1xdErqGoE/828j2nSjL7BSGRwDEOI3AG59uFOQ Ssh/DmjqYfeij1r+Ov4dwGPepbYlsyXBYohB0= 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=oPZlDpHAx9Ht925QqCXy+irbQ1RALfaKvufqfu4S91c=; b=l4LbZh7EfHPipAL/XApl0G2wvK9xcfJzVvvElZkKDHKQoHTH6t/7p/pi16ZEzRoAaB ScQxh3asiUznysRcF2mLFWBqyGu8eUWZsDsvueLSN9p7Aufr36T/bCdBFNJ8RQt77P9Y Pak3gbrgT4fCS31fEZiwUoZbCLJ+Ya2PLXEv8mv9vyfxrzuXFf0yNyeCNOaaokrPmGW0 sDYwFtGC00FHehsY3nnyv0EJyixiwOizIifULHQjfDE2t4b6XqgDiD0sefMVxmfj/a5f S+OLeQDhv5uBrFlU6DNWkVZUbjlY4TmslT778RWpvbXvU0o3LaTxIrukV8zuqRJJjCN+ pdgg== X-Gm-Message-State: ALoCoQlO5nodxgIy4CRX0MT7lhOqFCG9lA/MGZiGcukYguIkX+Wtz7fIE2dAtb9SIdJlocZR+9YA X-Received: by 10.224.40.138 with SMTP id k10mr7000565qae.67.1381951635754; Wed, 16 Oct 2013 12:27:15 -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:15 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v2 04/26] drm/exynos: Use manager_op initialize in fimd Date: Wed, 16 Oct 2013 15:26:34 -0400 Message-Id: <1381951616-12548-5-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 implements the intitialize manager op in fimd. Signed-off-by: Sean Paul --- Changes in v2: None drivers/gpu/drm/exynos/exynos_drm_fimd.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index f271f22..90fcd6f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -106,6 +106,7 @@ struct fimd_win_data { struct fimd_context { struct exynos_drm_subdrv subdrv; + struct drm_device *drm_dev; int irq; struct drm_crtc *crtc; struct clk *bus_clk; @@ -490,6 +491,16 @@ static void fimd_win_disable(struct device *dev, int zpos) win_data->enabled = false; } +static int fimd_mgr_initialize(struct device *subdrv_dev, + struct drm_device *drm_dev) +{ + struct fimd_context *ctx = get_fimd_context(subdrv_dev); + + ctx->drm_dev = drm_dev; + + return 0; +} + static void fimd_dpms(struct device *subdrv_dev, int mode) { struct fimd_context *ctx = get_fimd_context(subdrv_dev); @@ -660,6 +671,7 @@ static void fimd_wait_for_vblank(struct device *dev) } static struct exynos_drm_manager_ops fimd_manager_ops = { + .initialize = fimd_mgr_initialize, .dpms = fimd_dpms, .apply = fimd_apply, .commit = fimd_commit, @@ -681,7 +693,6 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) { struct fimd_context *ctx = (struct fimd_context *)dev_id; struct exynos_drm_subdrv *subdrv = &ctx->subdrv; - struct drm_device *drm_dev = subdrv->drm_dev; struct exynos_drm_manager *manager = subdrv->manager; u32 val; @@ -692,11 +703,11 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) writel(VIDINTCON1_INT_FRAME, ctx->regs + VIDINTCON1); /* check the crtc is detached already from encoder */ - if (manager->pipe < 0) + if (manager->pipe < 0 || !ctx->drm_dev) goto out; - drm_handle_vblank(drm_dev, manager->pipe); - exynos_drm_crtc_finish_pageflip(drm_dev, manager->pipe); + drm_handle_vblank(ctx->drm_dev, manager->pipe); + exynos_drm_crtc_finish_pageflip(ctx->drm_dev, manager->pipe); /* set wait vsync event to zero and wake up queue. */ if (atomic_read(&ctx->wait_vsync_event)) {