From patchwork Tue Oct 29 16:12:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3109101 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 EC4BE9F2B7 for ; Tue, 29 Oct 2013 16:17:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B605C20304 for ; Tue, 29 Oct 2013 16:17:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8CEAA200F4 for ; Tue, 29 Oct 2013 16:17:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0830EEC01; Tue, 29 Oct 2013 09:14:10 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 3159DEEBCE for ; Tue, 29 Oct 2013 09:13:45 -0700 (PDT) Received: by mail-qe0-f47.google.com with SMTP id b4so45890qen.20 for ; Tue, 29 Oct 2013 09:13:44 -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=drfrr6e70rbemwRGGYFPIDpv9pMJfRJB8FH325pW8AQ=; b=GNBlVwqEMt3T5nFaj8bW/CP1iSqU40BRMhZVpJzNmgNhYfrAojj+8Fb7qwny4W24pR 9PRLACB8HXL6NRIM2vm13Y7wQqYaAzEhm/39tq+22WgrZDGfOX9TcWQklt4Rszu6r8oV YOUJbYWWl/wsgeX8lwOMANcMmy8iVLp6sJxmE= 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=drfrr6e70rbemwRGGYFPIDpv9pMJfRJB8FH325pW8AQ=; b=IT5u4aFersGWomoPZxy5LtdcqKXM3R6jfevW9RT1Ax5/l3aNlhyNoX13CZUSAWg6U4 qxr6FirCzyg0cK91gAGu0/LrkFf0wi43fzKtFjOsgA1sBVD4HVGvQ/ndZZMJTS/bjSAu aBHywYLB/fuOkeqrsibRAmh64+IhBlty8NP8V+gqKH8mpgB0JiQBeSOos92y5YnMQbe9 it2auUKT3znW/QJYvyAUABtStG6NLOKEhimhTeey33GmQdoUNzD2T6pUykdj77UK/NgV pXRWDTEMNHIK240tHH2f6WldvtNdFbhMzz7eS7nxnAPdwFV05b+EKSSrrwozDyYOBoaY v07w== X-Gm-Message-State: ALoCoQk1AoydMs2NwP7RJWdj97LzNUKjT6LdcOOO6Zn/pPWUuPFY0420b+GADv+ZNuyVExRKQmC/ X-Received: by 10.229.12.197 with SMTP id y5mr715774qcy.8.1383063224693; Tue, 29 Oct 2013 09:13:44 -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.13.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 09:13:43 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v3 04/32] drm/exynos: Use manager_op initialize in fimd Date: Tue, 29 Oct 2013 12:12:50 -0400 Message-Id: <1383063198-10526-5-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 implements the intitialize manager op in fimd. Signed-off-by: Sean Paul --- Changes in v2: None Changes in v3: 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)) {