Commit 38573dc1 authored by Ville Syrjälä's avatar Ville Syrjälä

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1464371966-15190-6-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 69ae561f
...@@ -14233,10 +14233,24 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, ...@@ -14233,10 +14233,24 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
primary->disable_plane = i9xx_disable_primary_plane; primary->disable_plane = i9xx_disable_primary_plane;
} }
ret = drm_universal_plane_init(dev, &primary->base, 0, if (INTEL_INFO(dev)->gen >= 9)
&intel_plane_funcs, ret = drm_universal_plane_init(dev, &primary->base, 0,
intel_primary_formats, num_formats, &intel_plane_funcs,
DRM_PLANE_TYPE_PRIMARY, NULL); intel_primary_formats, num_formats,
DRM_PLANE_TYPE_PRIMARY,
"plane 1%c", pipe_name(pipe));
else if (INTEL_INFO(dev)->gen >= 5 || IS_G4X(dev))
ret = drm_universal_plane_init(dev, &primary->base, 0,
&intel_plane_funcs,
intel_primary_formats, num_formats,
DRM_PLANE_TYPE_PRIMARY,
"primary %c", pipe_name(pipe));
else
ret = drm_universal_plane_init(dev, &primary->base, 0,
&intel_plane_funcs,
intel_primary_formats, num_formats,
DRM_PLANE_TYPE_PRIMARY,
"plane %c", plane_name(primary->plane));
if (ret) if (ret)
goto fail; goto fail;
...@@ -14394,7 +14408,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev, ...@@ -14394,7 +14408,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,
&intel_plane_funcs, &intel_plane_funcs,
intel_cursor_formats, intel_cursor_formats,
ARRAY_SIZE(intel_cursor_formats), ARRAY_SIZE(intel_cursor_formats),
DRM_PLANE_TYPE_CURSOR, NULL); DRM_PLANE_TYPE_CURSOR,
"cursor %c", pipe_name(pipe));
if (ret) if (ret)
goto fail; goto fail;
......
...@@ -1114,10 +1114,18 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) ...@@ -1114,10 +1114,18 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
possible_crtcs = (1 << pipe); possible_crtcs = (1 << pipe);
ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, if (INTEL_INFO(dev)->gen >= 9)
&intel_plane_funcs, ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs,
plane_formats, num_plane_formats, &intel_plane_funcs,
DRM_PLANE_TYPE_OVERLAY, NULL); plane_formats, num_plane_formats,
DRM_PLANE_TYPE_OVERLAY,
"plane %d%c", plane + 2, pipe_name(pipe));
else
ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs,
&intel_plane_funcs,
plane_formats, num_plane_formats,
DRM_PLANE_TYPE_OVERLAY,
"sprite %c", sprite_name(pipe, plane));
if (ret) if (ret)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment