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: 9942221 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 B98116035F for ; Thu, 7 Sep 2017 12:49:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E140285B5 for ; Thu, 7 Sep 2017 12:49:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93290285EA; Thu, 7 Sep 2017 12:49:52 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 29870285B5 for ; Thu, 7 Sep 2017 12:49:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97CCD6E930; Thu, 7 Sep 2017 12:49:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 601056E930 for ; Thu, 7 Sep 2017 12:49:47 +0000 (UTC) Received: by mail-lf0-x230.google.com with SMTP id q132so24241894lfe.5 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=frBNSHFW240ri1XB2ntjCBYtN0nMFLzqByURVlBSnK6Wx2RHbZZvDnUzu6rxS9uE0h p48cfr45YwFi/abYmF+OqS8hOLlCUCug0nA0bsnw+FiAXxNCbZZ/cqgxC/WJazVMBhZ0 zD5caHgufK9Zj2PL9fwx6kDtoYh+oCb6U93hpBqCQuRmxUDnZU2fg17p4+ygSbK+q8Yn Va1IYyuSFYBTEtvOqjr1u5n5FMfmCjtCR4pbhZhGVs5XuM7xSqorpiysHl7iL6VtoznN cXbpn+y9cMGMrXuwSbSFnHyuVmlvB7YdgL8xuZTuFrPEw8F5gdBgihjoOKhs9IMhM9U9 jJ6g== X-Gm-Message-State: AHPjjUioC9q6xIBG4DIjGnNonnqtKQ0LZ7TRH/y/mAmGdq1bNXzq5jfU Thj03TXHWZM2Pi9IgQcn8w== 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> Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);