From patchwork Wed Aug 30 18:07:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 111338 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1325182qge; Wed, 30 Aug 2017 11:07:58 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7ajp6iHz8VgiK9pz+vKitWPAcyZ1PnlStEuW+qF0k2UtedHtxLqSpjdIYhyN0CzLh5HzfK X-Received: by 10.84.217.11 with SMTP id o11mr3040994pli.245.1504116478890; Wed, 30 Aug 2017 11:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504116478; cv=none; d=google.com; s=arc-20160816; b=GfpAJfKkoh2m5CqqB491d9ir4HkRp/WFrfpbHdF8NrorVKoWPiARxTo5UPnbrgw/TR 6trj5OrolMF4PiB551zfPsjLL4ToCziLE60NpFwOgIdsKv2vLS5G1ghe/nylnW89RIID A6eU+QQTqoNeqsQY7AQ8ILV5gdUC/jUBsRhz1YET8WnnDKRblkv5yKb2b91pk+uqN8g8 MRnVg/j5SQXzRarzw2NKnZbjCo5VNhkkIoJwv0gp8iJfnDV2aMjp9m9DiwDj+oO4rjH3 f0+RMINR7xiJoRUtQ7pcnkbZfVR1JesLaljR0maDlr4bAEbngXqatV46NeUgN8uZUjVG n+qA== 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=/7/aQ+3D3J2zu/cqB4sMIyvmbSG5obf1QVC16M8rHW4=; b=PpZ6fsrdKrOmUXY3gymMyyzb4iHz48uak4pdIIfbYS64P8mAJPHUd6M6aDtZ68tXWL rJ1nuH/ApK0h0cGRuYcbDv9JL1CBdfMx6hkZ2i1f6XM2wmF2oV7qgJ/diDBHZG3FqTgf FawclqM8AK3zhzXzsxysYuCCdYaA+VEfjb92Wca171t4517TtFJXD8gapf7Z350L0Mtf j4ZiSgdnGkHgFyUBVGYWolEJczsZO9G2F+BoymGAzdDEtxLN5f4X2Ws/hTw3IbucJZso i7z+RPu+I27meAlOSLegJ79GLKV3mkv8tehYbeGaxeOe3FXveGFpYoTqTaf9L0LU1Jm4 RAGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iw9lMzvx; 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 b28si4850157pfl.331.2017.08.30.11.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 11:07:58 -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=iw9lMzvx; 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 572866E4EA; Wed, 30 Aug 2017 18:07:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 266F86E4EA for ; Wed, 30 Aug 2017 18:07:49 +0000 (UTC) Received: by mail-lf0-x22d.google.com with SMTP id a126so27578872lfa.0 for ; Wed, 30 Aug 2017 11:07:49 -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=9I3TrHDocg6MUoBbHcPbr2FFOYKqsCYkz86RwlG+6Pw=; b=iw9lMzvxEFIgPTqtXgxydf3+sfqKx3vVV17O8PgMt/DWKRTCuJGMBW+JD7D/WlNInB l68t2aCV0IRot2j6KQ7yhuYE/qt5zXtNxCxXwJgZI28U1/Yh1lDQjfqgzqeDNQzgbyCy yRoeyubq9LuNedswBsU+/sXxOq18ha+Gsyyeg= 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=9I3TrHDocg6MUoBbHcPbr2FFOYKqsCYkz86RwlG+6Pw=; b=fvTeZkWpgIpF6jPVWucaxK5ND3yIqIQDxbwo/Fye3DXQuASUTE/V3YFbi+Ikvf0QJT hgLNkMw0m/dPBtNS7q5fG8nGbCrm3snX/s+NYvPAwVpAq3fKKkIvECc49I1KkKfw2d5U MFo6NSnKQNFcV3k/fy2gLJyuPqnBvybTq5Ze0aJwnzWZtEFIBuE+TcsdpsusjFP+IRZh /0gFp1GalDxDV8mWFBZkHpNZMk/PA3WG6B2XAwWH1Qy6Uf6Ow0wZnxJAOF7eD7wFmw+r w28ewmlZbbFQi1sTh8YDSDM7qaIhjZmB0reHPEkAop3kfnBf7MZ47hin6XeXpbWFfjSY 6GyQ== X-Gm-Message-State: AHPjjUgxPxIyz4k2vri0KyJcjA7aWnFby2bV9eTiVvxPlekq6s58eX+t cUPDgXXL8nTn+inB X-Received: by 10.25.115.73 with SMTP id o70mr1019893lfc.209.1504116467581; Wed, 30 Aug 2017 11:07:47 -0700 (PDT) Received: from genomnajs.bredbandsbolaget.se (c-287571d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.117.40]) by smtp.gmail.com with ESMTPSA id 123sm1177067ljf.80.2017.08.30.11.07.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2017 11:07:37 -0700 (PDT) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 6/7] drm/pl111: Add optional variant display en/disable callbacks Date: Wed, 30 Aug 2017 20:07:10 +0200 Message-Id: <20170830180711.2791-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170830180711.2791-1-linus.walleij@linaro.org> References: <20170830180711.2791-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 --- drivers/gpu/drm/pl111/pl111_display.c | 7 +++++++ drivers/gpu/drm/pl111/pl111_drm.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index 39106068b158..37f409867934 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, * We expect these calls to enable and stabilize the contrast * voltage Vee as stipulated by the manual */ + if (priv->variant_display_enable) + priv->variant_display_enable(drm, fb->format->format); + drm_panel_enable(priv->panel); /* Power Up */ @@ -238,6 +241,10 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe) * stipulated by the manual */ drm_panel_disable(priv->panel); + + if (priv->variant_display_disable) + priv->variant_display_disable(drm); + drm_panel_unprepare(priv->panel); /* Disable */ diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h index b316a8a0fbc0..a5368d36e9f5 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; 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);