diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-05-27 13:59:23 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-05-30 10:02:10 -0400 |
commit | 38573dc1c316620beb0c27c2517f9b5c2c4ecdd4 (patch) | |
tree | c2dabb9d1c12a5ecb487ab6156cb55a11ba02ca8 /drivers | |
parent | 69ae561f4557d31a1dc6d23db5c2735a5568959c (diff) |
drm/i915: Give meaningful names to all the planes
Let's name our planes in a way that makes sense wrt. the spec:
- skl+ -> "plane 1A", "plane 2A", "plane 1C", "cursor A" etc.
- g4x+ -> "primary A", "primary B", "sprite A", "cursor C" etc.
- pre-g4x -> "plane A", "cursor B" etc.
v2: Rebase on top of the fixed/cleaned error paths
Use a local 'name' variable to make things easier
v3: Pass the name as a function argument to drm_universal_plane_init() (Jani)
v3: Pass the printf style string to drm_universal_plane_init()
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464371966-15190-6-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sprite.c | 16 |
2 files changed, 32 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index ada0198510d7..888fc3ff8d6b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -14233,10 +14233,24 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, | |||
14233 | primary->disable_plane = i9xx_disable_primary_plane; | 14233 | primary->disable_plane = i9xx_disable_primary_plane; |
14234 | } | 14234 | } |
14235 | 14235 | ||
14236 | ret = drm_universal_plane_init(dev, &primary->base, 0, | 14236 | if (INTEL_INFO(dev)->gen >= 9) |
14237 | &intel_plane_funcs, | 14237 | ret = drm_universal_plane_init(dev, &primary->base, 0, |
14238 | intel_primary_formats, num_formats, | 14238 | &intel_plane_funcs, |
14239 | DRM_PLANE_TYPE_PRIMARY, NULL); | 14239 | intel_primary_formats, num_formats, |
14240 | DRM_PLANE_TYPE_PRIMARY, | ||
14241 | "plane 1%c", pipe_name(pipe)); | ||
14242 | else if (INTEL_INFO(dev)->gen >= 5 || IS_G4X(dev)) | ||
14243 | ret = drm_universal_plane_init(dev, &primary->base, 0, | ||
14244 | &intel_plane_funcs, | ||
14245 | intel_primary_formats, num_formats, | ||
14246 | DRM_PLANE_TYPE_PRIMARY, | ||
14247 | "primary %c", pipe_name(pipe)); | ||
14248 | else | ||
14249 | ret = drm_universal_plane_init(dev, &primary->base, 0, | ||
14250 | &intel_plane_funcs, | ||
14251 | intel_primary_formats, num_formats, | ||
14252 | DRM_PLANE_TYPE_PRIMARY, | ||
14253 | "plane %c", plane_name(primary->plane)); | ||
14240 | if (ret) | 14254 | if (ret) |
14241 | goto fail; | 14255 | goto fail; |
14242 | 14256 | ||
@@ -14394,7 +14408,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev, | |||
14394 | &intel_plane_funcs, | 14408 | &intel_plane_funcs, |
14395 | intel_cursor_formats, | 14409 | intel_cursor_formats, |
14396 | ARRAY_SIZE(intel_cursor_formats), | 14410 | ARRAY_SIZE(intel_cursor_formats), |
14397 | DRM_PLANE_TYPE_CURSOR, NULL); | 14411 | DRM_PLANE_TYPE_CURSOR, |
14412 | "cursor %c", pipe_name(pipe)); | ||
14398 | if (ret) | 14413 | if (ret) |
14399 | goto fail; | 14414 | goto fail; |
14400 | 14415 | ||
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 97b1a54eb09f..324ccb06397d 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c | |||
@@ -1114,10 +1114,18 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | |||
1114 | 1114 | ||
1115 | possible_crtcs = (1 << pipe); | 1115 | possible_crtcs = (1 << pipe); |
1116 | 1116 | ||
1117 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, | 1117 | if (INTEL_INFO(dev)->gen >= 9) |
1118 | &intel_plane_funcs, | 1118 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, |
1119 | plane_formats, num_plane_formats, | 1119 | &intel_plane_funcs, |
1120 | DRM_PLANE_TYPE_OVERLAY, NULL); | 1120 | plane_formats, num_plane_formats, |
1121 | DRM_PLANE_TYPE_OVERLAY, | ||
1122 | "plane %d%c", plane + 2, pipe_name(pipe)); | ||
1123 | else | ||
1124 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, | ||
1125 | &intel_plane_funcs, | ||
1126 | plane_formats, num_plane_formats, | ||
1127 | DRM_PLANE_TYPE_OVERLAY, | ||
1128 | "sprite %c", sprite_name(pipe, plane)); | ||
1121 | if (ret) | 1129 | if (ret) |
1122 | goto fail; | 1130 | goto fail; |
1123 | 1131 | ||