diff mbox

[1/2] drm/tegra: Fix possible CRTC mask for RGB outputs

Message ID 1389622894-9574-2-git-send-email-treding@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding Jan. 13, 2014, 2:21 p.m. UTC
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 <treding@nvidia.com>
---
 drivers/gpu/drm/tegra/rgb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Warren Jan. 13, 2014, 5:44 p.m. UTC | #1
On 01/13/2014 07:21 AM, Thierry Reding wrote:
> 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.

> diff --git 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->output.encoder.possible_crtcs = 1 << dc->pipe;
> +	rgb->output.encoder.possible_crtcs = drm_crtc_mask(&dc->base);

For me, on top of either next-20140109 or next-20140113, this causes:

> drivers/gpu/drm/tegra/rgb.c: In function ‘tegra_dc_rgb_init’:
> drivers/gpu/drm/tegra/rgb.c:261:2: error: implicit declaration of function ‘drm_crtc_mask’ [-Werror=implicit-function-declaration]
Thierry Reding Jan. 14, 2014, 1:45 p.m. UTC | #2
On Mon, Jan 13, 2014 at 10:44:26AM -0700, Stephen Warren wrote:
> On 01/13/2014 07:21 AM, Thierry Reding wrote:
> > 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.
> 
> > diff --git 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->output.encoder.possible_crtcs = 1 << dc->pipe;
> > +	rgb->output.encoder.possible_crtcs = drm_crtc_mask(&dc->base);
> 
> For me, on top of either next-20140109 or next-20140113, this causes:
> 
> > drivers/gpu/drm/tegra/rgb.c: In function ‘tegra_dc_rgb_init’:
> > drivers/gpu/drm/tegra/rgb.c:261:2: error: implicit declaration of function ‘drm_crtc_mask’ [-Werror=implicit-function-declaration]

It depends on a separate patch that I sent earlier yesterday. I thought
I had Cc'ed you and the linux-tegra mailing list on that patch, but I'm
misremembering apparently. Here's a link to the patch:

	https://patchwork.kernel.org/patch/3475421/

Thierry
diff mbox

Patch

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;
 }