mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 03:44:27 +08:00
drm/i915: Eliminate redundancy in intel_primary_plane_create()
Lots of redundant assignments inside intel_primary_plane_create(). Get rid of them. v2: Rebase due to fp16 landing Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191031165652.10868-8-ville.syrjala@linux.intel.com
This commit is contained in:
parent
12fef149d7
commit
dbb1a6fbbb
@ -15540,7 +15540,6 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
const struct drm_plane_funcs *plane_funcs;
|
||||
unsigned int supported_rotations;
|
||||
unsigned int possible_crtcs;
|
||||
const u64 *modifiers;
|
||||
const u32 *formats;
|
||||
int num_formats;
|
||||
int ret, zpos;
|
||||
@ -15575,16 +15574,6 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
||||
formats = vlv_primary_formats;
|
||||
num_formats = ARRAY_SIZE(vlv_primary_formats);
|
||||
modifiers = i9xx_format_modifiers;
|
||||
|
||||
plane->max_stride = i9xx_plane_max_stride;
|
||||
plane->update_plane = i9xx_update_plane;
|
||||
plane->disable_plane = i9xx_disable_plane;
|
||||
plane->get_hw_state = i9xx_plane_get_hw_state;
|
||||
plane->check_plane = i9xx_plane_check;
|
||||
plane->min_cdclk = vlv_plane_min_cdclk;
|
||||
|
||||
plane_funcs = &i965_plane_funcs;
|
||||
} else if (INTEL_GEN(dev_priv) >= 4) {
|
||||
/*
|
||||
* WaFP16GammaEnabling:ivb
|
||||
@ -15606,50 +15595,45 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
formats = i965_primary_formats;
|
||||
num_formats = ARRAY_SIZE(i965_primary_formats);
|
||||
}
|
||||
|
||||
modifiers = i9xx_format_modifiers;
|
||||
|
||||
plane->max_stride = i9xx_plane_max_stride;
|
||||
plane->update_plane = i9xx_update_plane;
|
||||
plane->disable_plane = i9xx_disable_plane;
|
||||
plane->get_hw_state = i9xx_plane_get_hw_state;
|
||||
plane->check_plane = i9xx_plane_check;
|
||||
|
||||
if (IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv))
|
||||
plane->min_cdclk = hsw_plane_min_cdclk;
|
||||
else if (IS_IVYBRIDGE(dev_priv))
|
||||
plane->min_cdclk = ivb_plane_min_cdclk;
|
||||
else
|
||||
plane->min_cdclk = i9xx_plane_min_cdclk;
|
||||
|
||||
plane_funcs = &i965_plane_funcs;
|
||||
} else {
|
||||
formats = i8xx_primary_formats;
|
||||
num_formats = ARRAY_SIZE(i8xx_primary_formats);
|
||||
modifiers = i9xx_format_modifiers;
|
||||
}
|
||||
|
||||
plane->max_stride = i9xx_plane_max_stride;
|
||||
plane->update_plane = i9xx_update_plane;
|
||||
plane->disable_plane = i9xx_disable_plane;
|
||||
plane->get_hw_state = i9xx_plane_get_hw_state;
|
||||
plane->check_plane = i9xx_plane_check;
|
||||
if (INTEL_GEN(dev_priv) >= 4)
|
||||
plane_funcs = &i965_plane_funcs;
|
||||
else
|
||||
plane_funcs = &i8xx_plane_funcs;
|
||||
|
||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
|
||||
plane->min_cdclk = vlv_plane_min_cdclk;
|
||||
else if (IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv))
|
||||
plane->min_cdclk = hsw_plane_min_cdclk;
|
||||
else if (IS_IVYBRIDGE(dev_priv))
|
||||
plane->min_cdclk = ivb_plane_min_cdclk;
|
||||
else
|
||||
plane->min_cdclk = i9xx_plane_min_cdclk;
|
||||
|
||||
plane_funcs = &i8xx_plane_funcs;
|
||||
}
|
||||
plane->max_stride = i9xx_plane_max_stride;
|
||||
plane->update_plane = i9xx_update_plane;
|
||||
plane->disable_plane = i9xx_disable_plane;
|
||||
plane->get_hw_state = i9xx_plane_get_hw_state;
|
||||
plane->check_plane = i9xx_plane_check;
|
||||
|
||||
possible_crtcs = BIT(pipe);
|
||||
|
||||
if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
|
||||
ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
|
||||
possible_crtcs, plane_funcs,
|
||||
formats, num_formats, modifiers,
|
||||
formats, num_formats,
|
||||
i9xx_format_modifiers,
|
||||
DRM_PLANE_TYPE_PRIMARY,
|
||||
"primary %c", pipe_name(pipe));
|
||||
else
|
||||
ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
|
||||
possible_crtcs, plane_funcs,
|
||||
formats, num_formats, modifiers,
|
||||
formats, num_formats,
|
||||
i9xx_format_modifiers,
|
||||
DRM_PLANE_TYPE_PRIMARY,
|
||||
"plane %c",
|
||||
plane_name(plane->i9xx_plane));
|
||||
|
Loading…
Reference in New Issue
Block a user