Commit 881440a8 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Rename variables in intel_primary_plane_create()

Let's try to stick a common naming pattern in all the plane init funcs.

v2: Rebase due to color_encoding/range props
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181005125817.22576-12-ville.syrjala@linux.intel.com
parent a86d2590
...@@ -13618,64 +13618,64 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv, ...@@ -13618,64 +13618,64 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
static struct intel_plane * static struct intel_plane *
intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
{ {
struct intel_plane *primary; struct intel_plane *plane;
const struct drm_plane_funcs *plane_funcs; const struct drm_plane_funcs *plane_funcs;
const uint32_t *intel_primary_formats;
unsigned int supported_rotations; unsigned int supported_rotations;
unsigned int possible_crtcs; unsigned int possible_crtcs;
unsigned int num_formats; const u64 *modifiers;
const uint64_t *modifiers; const u32 *formats;
int num_formats;
int ret; int ret;
if (INTEL_GEN(dev_priv) >= 9) if (INTEL_GEN(dev_priv) >= 9)
return skl_universal_plane_create(dev_priv, pipe, return skl_universal_plane_create(dev_priv, pipe,
PLANE_PRIMARY); PLANE_PRIMARY);
primary = intel_plane_alloc(); plane = intel_plane_alloc();
if (IS_ERR(primary)) if (IS_ERR(plane))
return primary; return plane;
primary->pipe = pipe; plane->pipe = pipe;
/* /*
* On gen2/3 only plane A can do FBC, but the panel fitter and LVDS * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
* port is hooked to pipe B. Hence we want plane A feeding pipe B. * port is hooked to pipe B. Hence we want plane A feeding pipe B.
*/ */
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4) if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
primary->i9xx_plane = (enum i9xx_plane_id) !pipe; plane->i9xx_plane = (enum i9xx_plane_id) !pipe;
else else
primary->i9xx_plane = (enum i9xx_plane_id) pipe; plane->i9xx_plane = (enum i9xx_plane_id) pipe;
primary->id = PLANE_PRIMARY; plane->id = PLANE_PRIMARY;
primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id); plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary->i9xx_plane); plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane->i9xx_plane);
if (primary->has_fbc) { if (plane->has_fbc) {
struct intel_fbc *fbc = &dev_priv->fbc; struct intel_fbc *fbc = &dev_priv->fbc;
fbc->possible_framebuffer_bits |= primary->frontbuffer_bit; fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
} }
if (INTEL_GEN(dev_priv) >= 4) { if (INTEL_GEN(dev_priv) >= 4) {
intel_primary_formats = i965_primary_formats; formats = i965_primary_formats;
num_formats = ARRAY_SIZE(i965_primary_formats); num_formats = ARRAY_SIZE(i965_primary_formats);
modifiers = i9xx_format_modifiers; modifiers = i9xx_format_modifiers;
primary->max_stride = i9xx_plane_max_stride; plane->max_stride = i9xx_plane_max_stride;
primary->update_plane = i9xx_update_plane; plane->update_plane = i9xx_update_plane;
primary->disable_plane = i9xx_disable_plane; plane->disable_plane = i9xx_disable_plane;
primary->get_hw_state = i9xx_plane_get_hw_state; plane->get_hw_state = i9xx_plane_get_hw_state;
primary->check_plane = i9xx_plane_check; plane->check_plane = i9xx_plane_check;
plane_funcs = &i965_plane_funcs; plane_funcs = &i965_plane_funcs;
} else { } else {
intel_primary_formats = i8xx_primary_formats; formats = i8xx_primary_formats;
num_formats = ARRAY_SIZE(i8xx_primary_formats); num_formats = ARRAY_SIZE(i8xx_primary_formats);
modifiers = i9xx_format_modifiers; modifiers = i9xx_format_modifiers;
primary->max_stride = i9xx_plane_max_stride; plane->max_stride = i9xx_plane_max_stride;
primary->update_plane = i9xx_update_plane; plane->update_plane = i9xx_update_plane;
primary->disable_plane = i9xx_disable_plane; plane->disable_plane = i9xx_disable_plane;
primary->get_hw_state = i9xx_plane_get_hw_state; plane->get_hw_state = i9xx_plane_get_hw_state;
primary->check_plane = i9xx_plane_check; plane->check_plane = i9xx_plane_check;
plane_funcs = &i8xx_plane_funcs; plane_funcs = &i8xx_plane_funcs;
} }
...@@ -13683,20 +13683,18 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -13683,20 +13683,18 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
possible_crtcs = BIT(pipe); possible_crtcs = BIT(pipe);
if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
ret = drm_universal_plane_init(&dev_priv->drm, &primary->base, ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
possible_crtcs, plane_funcs, possible_crtcs, plane_funcs,
intel_primary_formats, num_formats, formats, num_formats, modifiers,
modifiers,
DRM_PLANE_TYPE_PRIMARY, DRM_PLANE_TYPE_PRIMARY,
"primary %c", pipe_name(pipe)); "primary %c", pipe_name(pipe));
else else
ret = drm_universal_plane_init(&dev_priv->drm, &primary->base, ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
possible_crtcs, plane_funcs, possible_crtcs, plane_funcs,
intel_primary_formats, num_formats, formats, num_formats, modifiers,
modifiers,
DRM_PLANE_TYPE_PRIMARY, DRM_PLANE_TYPE_PRIMARY,
"plane %c", "plane %c",
plane_name(primary->i9xx_plane)); plane_name(plane->i9xx_plane));
if (ret) if (ret)
goto fail; goto fail;
...@@ -13712,16 +13710,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -13712,16 +13710,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
} }
if (INTEL_GEN(dev_priv) >= 4) if (INTEL_GEN(dev_priv) >= 4)
drm_plane_create_rotation_property(&primary->base, drm_plane_create_rotation_property(&plane->base,
DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0,
supported_rotations); supported_rotations);
drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs); drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
return primary; return plane;
fail: fail:
intel_plane_free(primary); intel_plane_free(plane);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
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