From patchwork Thu Sep 7 12:49:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9942235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F2636035F for ; Thu, 7 Sep 2017 12:52:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79750205FB for ; Thu, 7 Sep 2017 12:52:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C87E28536; Thu, 7 Sep 2017 12:52:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB6E2205FB for ; Thu, 7 Sep 2017 12:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=JXLsA+W+WddQjd4qzIJ69tKUrOibYQPd0MN8bmtKSpg=; b=PEnQixr6uVAm0+0/C2oF1hLi/b XjM9cUGbVapWjBh2gXLkSXZRCAHz0dF1IgAE2N+zJZNJ6VDkG3dNv2BW2W5bHZ6/fojLNXVIzUqGR GdY2iKfvk4ynRW3cYTg6y0J1vla0hG36qnp0XDreW+hJzMnm5uvuZMHb/uv6na41Lde+l+76VePoN +2zfgXMTtwCxKfK2YLquHu0YPCmUz7f7AaChxnGnCpkzN8kb2B6T5cVEkwGK7t7j5hjcI1MJo+Koo CfqLYd8fVkunsUHTSpZSuEEumeKyZzTyBDhcuH4pBIkp5lj4HvxQEXiC0WpTtM54XcSNfKPEVZ5BH J8YFImqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dpwHs-0002Pa-Rt; Thu, 07 Sep 2017 12:52:04 +0000 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dpwFz-00082f-OI for linux-arm-kernel@lists.infradead.org; Thu, 07 Sep 2017 12:50:24 +0000 Received: by mail-lf0-x230.google.com with SMTP id m199so24254895lfe.3 for ; Thu, 07 Sep 2017 05:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XEMKQeRNvLYWPppqoNTO8G+t+oOBjGeBZjwBfM6AzIQ=; b=XHa9p3op2OByja2UAVLgDJbeboFEVFI5O/gnuVZvx8PMxbB22W7EvhNXW9zx8VxJNU c9Xm81B9Me5NdJ81t8602tawZsWFOMpkx7oFJFcUe+hUW7z+QfBiVkgGK7EkxSUHhUuK ViJ/X0IC8U+WfFmENQ6m5ZXX7nNAydeNBfwbo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XEMKQeRNvLYWPppqoNTO8G+t+oOBjGeBZjwBfM6AzIQ=; b=nBZPpgSqkHpcODC4389/BrFFoOicPsWg0GuCsyQ0gNhCYxsJELeB82WpkNhiNne6LD 0yOaLkOXEdxgR/y957D8Gu0aJmp5/IPSLsR547I0ND3U8u/rQXBcizN2xRQ8cWJ04bFQ EO9rgXrB08DpvLLaVaxRXq0j4MrB2XsN0DRYqxzxaFNeRvm1SrBBSGsQnWxc23Rs52ce /p4If/YAK/L+11xabanEGi0thjMD6YoPWBdV0x8r0ZvHw92oCZkm2AGincSu072tFe+6 ezlyaLgK6oOLVKienMmOOQpt7iZICTHbHpnGYyPvlQSPebs8pvufPtgSk0fMzjYPQwiO o36g== X-Gm-Message-State: AHPjjUheygrLZsf6YHMHuHkhTksTxFRd0vznc5b6YfkKICZ29RBqfxqU pwQkApACGLSdHUWK X-Google-Smtp-Source: ADKCNb56/coZNsncjg5IpI54Q3nQ6yPhhDl6LP06trkCjkWpySuGlHi25ZcbzzWun/U/yzKlE0oaTA== X-Received: by 10.46.77.193 with SMTP id c62mr1286410ljd.82.1504788585663; Thu, 07 Sep 2017 05:49:45 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id g65sm405841ljb.86.2017.09.07.05.49.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 05:49:45 -0700 (PDT) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 6/7 v3] drm/pl111: Add optional variant display en/disable callbacks Date: Thu, 7 Sep 2017 14:49:24 +0200 Message-Id: <20170907124925.13805-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907124925.13805-1-linus.walleij@linaro.org> References: <20170907124925.13805-1-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170907_055008_558947_B63B183C X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The silcon and components around the PL111 may require some variants to perform special set-up of the display. Add two callbacks to manage this. Reviewed-by: Eric Anholt Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Rebase on DRM-TIP ChangeLog v1->v2: - Rebase on other display driver changes. --- drivers/gpu/drm/pl111/pl111_display.c | 6 ++++++ drivers/gpu/drm/pl111/pl111_drm.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index b7df9f5df881..68847a074331 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -208,6 +208,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, */ msleep(20); + if (priv->variant_display_enable) + priv->variant_display_enable(drm, fb->format->format); + /* Power Up */ cntl |= CNTL_LCDPWR; writel(cntl, priv->regs + priv->ctrl); @@ -237,6 +240,9 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe) */ msleep(20); + if (priv->variant_display_disable) + priv->variant_display_disable(drm); + /* Disable */ writel(0, priv->regs + priv->ctrl); diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h index b380a7b4fb58..440f53ebee8c 100644 --- a/drivers/gpu/drm/pl111/pl111_drm.h +++ b/drivers/gpu/drm/pl111/pl111_drm.h @@ -26,6 +26,7 @@ #include #include #include +#include #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2) @@ -66,6 +67,8 @@ struct pl111_drm_dev_private { */ spinlock_t tim2_lock; const struct pl111_variant_data *variant; + void (*variant_display_enable) (struct drm_device *drm, u32 format); + void (*variant_display_disable) (struct drm_device *drm); }; int pl111_display_init(struct drm_device *dev);