From patchwork Mon Jan 13 14:21:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3475491 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 7DF519F2E9 for ; Mon, 13 Jan 2014 14:21:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 451AF20122 for ; Mon, 13 Jan 2014 14:21:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7F41D200E8 for ; Mon, 13 Jan 2014 14:21:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF14911E845; Mon, 13 Jan 2014 06:21:47 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B0C211E845 for ; Mon, 13 Jan 2014 06:21:39 -0800 (PST) Received: by mail-bk0-f52.google.com with SMTP id d7so1007982bkh.11 for ; Mon, 13 Jan 2014 06:21:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i1Weje/r4eAXNhOLNGObwiinGsWEYtRdd/Aaqx32GvY=; b=Y+b20ZWOlUWA/LzOpRWbYku+dDKpJ0/0F0Wljm1r8Sa/YLam27hwY7IXv1FxSbbKmN iHNj107mrA2rQ9Lg+E0EczkP3C0Y+EOVrdL/FxsXVymoDw0sGVEQ0jnmvDR0zhkpVaiB dzhBpmoO3+ILXO7x0W2G8j6Vvh1DVreKfEwmclzbEyrPy9zAGdSdxJQOq1eqfRtSrbmZ 3/64HvKkFerTh/0Km7iYFMA1A+507kDLM0bmfVNr0ce98k0U55qjfuzcB7JEujV+I6As SzIXvzbELjSzIDaP6g+kLruH+clZ9OCITwnKICq7V0UxS4k2U2C67tIncskEPyZVeuCQ Uv6g== X-Received: by 10.204.66.8 with SMTP id l8mr619148bki.141.1389622898607; Mon, 13 Jan 2014 06:21:38 -0800 (PST) Received: from localhost (port-52867.pppoe.wtnet.de. [46.59.207.43]) by mx.google.com with ESMTPSA id e3sm15886652bkk.13.2014.01.13.06.21.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2014 06:21:37 -0800 (PST) From: Thierry Reding To: Stephen Warren , David Airlie Subject: [PATCH 1/2] drm/tegra: Fix possible CRTC mask for RGB outputs Date: Mon, 13 Jan 2014 15:21:33 +0100 Message-Id: <1389622894-9574-2-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389622894-9574-1-git-send-email-treding@nvidia.com> References: <1389622894-9574-1-git-send-email-treding@nvidia.com> Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.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.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 The mask of possible CRTCs that an output (DRM encoder) can be attached to is relative to the position within the DRM device's list of CRTCs. Deferred probing can cause this to not match the pipe number associated with a CRTC. Use the newly introduced drm_crtc_mask() to compute the mask by looking up the proper index of the given CRTC in the list. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c index 03885bb8dcc0..338f7f6561d7 100644 --- a/drivers/gpu/drm/tegra/rgb.c +++ b/drivers/gpu/drm/tegra/rgb.c @@ -258,7 +258,7 @@ int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc) * RGB outputs are an exception, so we make sure they can be attached * to only their parent display controller. */ - rgb->output.encoder.possible_crtcs = 1 << dc->pipe; + rgb->output.encoder.possible_crtcs = drm_crtc_mask(&dc->base); return 0; }