From patchwork Thu Jan 30 21:19:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3559381 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 B30409F381 for ; Thu, 30 Jan 2014 21:22:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACCAC20181 for ; Thu, 30 Jan 2014 21:22:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B90D120173 for ; Thu, 30 Jan 2014 21:22:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B9C27C2BF4; Thu, 30 Jan 2014 13:22:17 -0800 (PST) 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 9151A45106 for ; Thu, 30 Jan 2014 13:20:00 -0800 (PST) Received: by mail-qa0-f52.google.com with SMTP id j15so5109210qaq.25 for ; Thu, 30 Jan 2014 13:19:59 -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=CYYMt0h/lY/NurHrE6fpfNjJu46eScQgRVSaljz3e90=; b=XOoxdNE36xD28UooIqesZX2QQeAqqHZwpwzCNR57krOWXb7jAQC3Q8E6YxltV8IiTC QilkZUxEb1qaEAW1G8eqVtHyZSOxDJOKoTuqSqhnzYcSoeTjURU/R3RXc2lOMYfEc7qm k+TJHAYoPG3DbN91KvWcQPHgGy1UXwLFLzfpM= 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=CYYMt0h/lY/NurHrE6fpfNjJu46eScQgRVSaljz3e90=; b=A6eQu9niir81qFNpDTGEKm4lovtHfkWNX8TWpt4K1YItK1KAJRTzH1cSPN8Dorpevt OM2xTpMrDU9O7+iohyI9m/kitX9Zibs7QWnDXIEiMKpL1J6RxaqHgCQ4QIZ1KeUVLgKe HEyCWtw3RLvKhSxeYfhtKYe7NAvfeyYTpxqH/wStYCTne3rIjv51CbaPPevnnuHv/iPX PNfYykqDucEwssfPKOcr6iF8oNutI/ukkrpVMxFrrKvwDrGyqRLh8LoMn+OzjZkR7ieC dfF0dSrcSA6vtK4JgeJxViZOt8Xhwcu4iv8jV3bZ92Nx2MspNbuLUuj1z6pag03F76kK DmQA== X-Gm-Message-State: ALoCoQktnNIvk+2lzuyy7y7JfH16ftXHbmHcmejWQiZUYwGmXlpiJSRcq9LoJgIVnUzrNwEmsBYL X-Received: by 10.229.179.5 with SMTP id bo5mr25800708qcb.21.1391116799588; Thu, 30 Jan 2014 13:19:59 -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.19.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Jan 2014 13:19:59 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v4 05/34] drm/exynos: Use manager_op initialize in fimd Date: Thu, 30 Jan 2014 16:19:04 -0500 Message-Id: <1391116773-28471-6-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 implements the intitialize manager op in fimd. This will allow us to keep track of drm_dev in context instead of using subdev, which in turn makes it easier to remove subdev from fimd. Signed-off-by: Sean Paul --- Changes in v2: None Changes in v3: None Changes in v4: - Expanded commit message to be more detailed 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 bc4001e..f06a0a9 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; @@ -181,6 +182,16 @@ static struct exynos_drm_display_ops fimd_display_ops = { .power_on = fimd_display_power_on, }; +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_win_disable(struct device *dev, int zpos) } 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)) {