From patchwork Tue Jan 14 14:45:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3485961 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3B7CEC02DC for ; Tue, 14 Jan 2014 14:46:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 370EE20240 for ; Tue, 14 Jan 2014 14:46:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 82C9C2021C for ; Tue, 14 Jan 2014 14:46:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18856FCC76; Tue, 14 Jan 2014 06:46:43 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f42.google.com (mail-bk0-f42.google.com [209.85.214.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 5087AFCC40 for ; Tue, 14 Jan 2014 06:46:01 -0800 (PST) Received: by mail-bk0-f42.google.com with SMTP id my12so257307bkb.29 for ; Tue, 14 Jan 2014 06:46:00 -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=QOVwj6+gXJQgLGZ0k5GyPXNhRCgRbdWgUZ1u+5ggUDs=; b=hCSah67ZfpwQy+8/lfiN60ePJcR7ZvMfZpOU9XEp9M622mvZo4dh1zWOuucrtT21nZ mgHco6Ol+zAFRsyJJgCbHneZwvy+Qn3/Cs1TjzY55NxzXtZkddxVVSkf3ysrq1iLcQdE T3p8eBYMMVyTWlJZKs9aUTq2csa+/FiFI5NPqUOCahzhfjxjvzeBHMVZogVk1AXIyZ9I Nm1rtx/rXKFceWqD2RTgAa4pfy5NSecgXkKkwgLGjzs3yGHNqpHkRL9PcZae/zglCSaw CxrQCj3xTVg4gru/hwkGVz0fbNuEByC8YnSpLT9cYGCgr/Al3VzivVh0jUWVcjALOUQP 6znA== X-Received: by 10.204.81.7 with SMTP id v7mr1248554bkk.3.1389710760342; Tue, 14 Jan 2014 06:46:00 -0800 (PST) Received: from localhost (port-33652.pppoe.wtnet.de. [46.59.182.73]) by mx.google.com with ESMTPSA id e3sm940076bkk.13.2014.01.14.06.45.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2014 06:45:59 -0800 (PST) From: Thierry Reding To: Stephen Warren , David Airlie Subject: [PATCH v2 1/2] drm/tegra: Fix possible CRTC mask for RGB outputs Date: Tue, 14 Jan 2014 15:45:57 +0100 Message-Id: <1389710758-29444-2-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389710758-29444-1-git-send-email-treding@nvidia.com> References: <1389710758-29444-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 --- This depends on the following patch: [v3,1/3] drm: provide a helper for the encoder possible_crtcs mask a copy of which can be found here: https://patchwork.kernel.org/patch/3475421/ 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; }