summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-01-10 16:56:06 +0100
committerThierry Reding <treding@nvidia.com>2014-01-10 16:56:06 +0100
commit4e5eef59718a88f83db8561dd09a4df217954024 (patch)
tree040e5e7053dc374a4ed801168d5584ee19eeb326
parent63a7cced7bcf862efc08a71938091d70080e3e8d (diff)
drm/tegra: Fix possible CRTC mask for RGB outputs
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_helper_crtc_possible_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>
-rw-r--r--drivers/gpu/drm/tegra/rgb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
index 03885bb8dcc0..eef637592fb3 100644
--- a/drivers/gpu/drm/tegra/rgb.c
+++ b/drivers/gpu/drm/tegra/rgb.c
@@ -239,6 +239,7 @@ int tegra_dc_rgb_remove(struct tegra_dc *dc)
int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc)
{
struct tegra_rgb *rgb = to_rgb(dc->rgb);
+ struct drm_encoder *encoder;
int err;
if (!dc->rgb)
@@ -253,12 +254,14 @@ int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc)
return err;
}
+ encoder = &rgb->output.encoder;
+
/*
* By default, outputs can be associated with each display controller.
* 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;
+ encoder->possible_crtcs = drm_helper_crtc_possible_mask(&dc->base);
return 0;
}