From patchwork Fri Sep 1 09:36:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 111474 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp785965qge; Fri, 1 Sep 2017 02:37:37 -0700 (PDT) X-Received: by 10.99.111.6 with SMTP id k6mr1703256pgc.138.1504258657416; Fri, 01 Sep 2017 02:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504258657; cv=none; d=google.com; s=arc-20160816; b=lIS1rRlf9MmDK68nfLEqu8dV9l9tJb8iywnWZR04KWplNVNOq7DAu2QYq8seETElYH T1DD3SqxZIZwrROmNaZ5gZs9K/QmM5p6huer9Lm27GvQmJjXyEsGa6Ma82nseVbFucG9 6pmCfeS5VJupuVqwXJfX6MPhf9EZT6uDGmdHva9bSbKPP8JdKLfWjXW6OjPyY+HpKdi0 zi3Wy0nHPXmT1Mftoewas8JMWkJizXEyWCZcRckLILlrvRpVmzqBczqjHxFbtY7VFA7D sYp3YJTZDn1chHQC6PWPaD5YhsZav5yOkx8ZXYzgYxMunhvvNd3kEXWJkAEuPAR31+Jl ysvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=2mZD0FovAGKZ6R5xyByMNPArSd5AxMjXYZ00H3hSISY=; b=NQx1043jvLPy2fhgDbr3Qty+xg6N9mJBAUp4M/6TggzIhmj5E7MY1XADVMihytQAVD HFHEs60zZ/VTUWYdjasxYFOG05/uSLNHtMH84xuXVanj8XBi0PJHcIL+Nu3BqaGY6p0i sgqE7tydmgDhNICkK40OHdIbATolqQecg1woC56Iuc8zLaJYx8hirCsXPe904fjPra4q BbX31ZW/Fh/WyecxrRk42AeMJEGeFUTsAOM37uvNBfzrszoxubjE3//pAteRRsGiO+Af 6pBl61Hk948F08PRqtUH55Zoejhe8ukXIqrS6Zb5WCbsWEzGoZChDwkVpwL1vn9nSGWQ IDXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UJoaMoSh; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z11si1583997pfl.452.2017.09.01.02.37.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Sep 2017 02:37:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UJoaMoSh; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0C586E819; Fri, 1 Sep 2017 09:37:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66CF66E814 for ; Fri, 1 Sep 2017 09:37:01 +0000 (UTC) Received: by mail-lf0-x22b.google.com with SMTP id d17so7316310lfe.1 for ; Fri, 01 Sep 2017 02:37:01 -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=KjD1PRJQp+SuXhWigSGZLuQ50pztlk1EB2ciyXUKI3Q=; b=UJoaMoShkd41wEbCa1kDGgATqPthK2NsAwsOgsEAyiPEjNXL8V35UCT+c/+lZnZxvM WRKj5ULr9D9qoTP1eN4uHzIVzz57prsiOckLTe0blHcGIRR+kLcDwWnfqCs9AvARUUic kR4XcMmYM3TtOhjV6nTvKsnruwjNKKEMDubcw= 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=KjD1PRJQp+SuXhWigSGZLuQ50pztlk1EB2ciyXUKI3Q=; b=DyPqyWbN2k0P///x3ABVzbXmZOxuwo00rS/lVq1gk7uRJjV6psPhIrvtQhg+jcH5gs tv7OeJQ6kO6zmosnXmEE111ed866J6VG71a6qzldP8wgcPwTtG18TF5MRMdyhPd0ZhBr xtK4THGBB53Dv29qNtQGIEZW75sUpiV3/GkV6l2oWXVi96bAUd9DMIz2zh5sYyLwa8i9 sUg18uAlnPbo5Z6+ao4P4RNa+p7x7itNhDnP45SRBPaXP0JSzmV85TtnYgAvcxHiT9nw hPVoDTxWCqKUH456yNEnbCYsSHaNUjAw3t4QZ8W1t+HAwPfE4T8/WOPO5mjGSfTS9pjB oP5A== X-Gm-Message-State: AHPjjUi9If1qyXoKPqFhYQXu3bdpv58RM2KuhrK1WrGN3QZD830rPtT1 DFCFj29kBrV/52I1 X-Google-Smtp-Source: ADKCNb5V4jgKUXL8RpCtrVHCg7TxM1A07KS90ksYwYVXRHaaYNNDuK+WriBqd4fC1F+O4BsR1YbUPw== X-Received: by 10.25.225.3 with SMTP id y3mr674386lfg.88.1504258619698; Fri, 01 Sep 2017 02:36:59 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id x18sm328588ljd.85.2017.09.01.02.36.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 02:36:59 -0700 (PDT) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 6/7 v2] drm/pl111: Add optional variant display en/disable callbacks Date: Fri, 1 Sep 2017 11:36:36 +0200 Message-Id: <20170901093637.4041-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170901093637.4041-1-linus.walleij@linaro.org> References: <20170901093637.4041-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" 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. Signed-off-by: Linus Walleij Reviewed-by: Eric Anholt --- 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 3ed451ca2744..5ca2c307856c 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -207,6 +207,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); @@ -236,6 +239,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 eeaabe735058..c28b5d042412 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) @@ -67,6 +68,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);