drm/i915/fb: move intel_tile_width_bytes() to intel_fb.c
Split out fb related stuff from intel_display.c to intel_fb.c. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/35c3ade81a54fea890cf92e21b778c38ab78cd04.1629721467.git.jani.nikula@intel.com
This commit is contained in:
parent
af182a236a
commit
d361688327
|
@ -879,60 +879,6 @@ intel_format_info_is_yuv_semiplanar(const struct drm_format_info *info,
|
|||
info->num_planes == (is_ccs_modifier(modifier) ? 4 : 2);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(fb->dev);
|
||||
unsigned int cpp = fb->format->cpp[color_plane];
|
||||
|
||||
switch (fb->modifier) {
|
||||
case DRM_FORMAT_MOD_LINEAR:
|
||||
return intel_tile_size(dev_priv);
|
||||
case I915_FORMAT_MOD_X_TILED:
|
||||
if (DISPLAY_VER(dev_priv) == 2)
|
||||
return 128;
|
||||
else
|
||||
return 512;
|
||||
case I915_FORMAT_MOD_Y_TILED_CCS:
|
||||
if (is_ccs_plane(fb, color_plane))
|
||||
return 128;
|
||||
fallthrough;
|
||||
case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS:
|
||||
case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC:
|
||||
case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
|
||||
if (is_ccs_plane(fb, color_plane))
|
||||
return 64;
|
||||
fallthrough;
|
||||
case I915_FORMAT_MOD_Y_TILED:
|
||||
if (DISPLAY_VER(dev_priv) == 2 || HAS_128_BYTE_Y_TILING(dev_priv))
|
||||
return 128;
|
||||
else
|
||||
return 512;
|
||||
case I915_FORMAT_MOD_Yf_TILED_CCS:
|
||||
if (is_ccs_plane(fb, color_plane))
|
||||
return 128;
|
||||
fallthrough;
|
||||
case I915_FORMAT_MOD_Yf_TILED:
|
||||
switch (cpp) {
|
||||
case 1:
|
||||
return 64;
|
||||
case 2:
|
||||
case 4:
|
||||
return 128;
|
||||
case 8:
|
||||
case 16:
|
||||
return 256;
|
||||
default:
|
||||
MISSING_CASE(cpp);
|
||||
return cpp;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
MISSING_CASE(fb->modifier);
|
||||
return cpp;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
intel_fb_align_height(const struct drm_framebuffer *fb,
|
||||
int color_plane, unsigned int height)
|
||||
|
|
|
@ -632,7 +632,6 @@ intel_get_crtc_new_encoder(const struct intel_atomic_state *state,
|
|||
|
||||
unsigned int intel_surf_alignment(const struct drm_framebuffer *fb,
|
||||
int color_plane);
|
||||
unsigned int intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane);
|
||||
|
||||
void intel_display_driver_register(struct drm_i915_private *i915);
|
||||
void intel_display_driver_unregister(struct drm_i915_private *i915);
|
||||
|
|
|
@ -79,6 +79,60 @@ unsigned int intel_tile_size(const struct drm_i915_private *i915)
|
|||
return DISPLAY_VER(i915) == 2 ? 2048 : 4096;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(fb->dev);
|
||||
unsigned int cpp = fb->format->cpp[color_plane];
|
||||
|
||||
switch (fb->modifier) {
|
||||
case DRM_FORMAT_MOD_LINEAR:
|
||||
return intel_tile_size(dev_priv);
|
||||
case I915_FORMAT_MOD_X_TILED:
|
||||
if (DISPLAY_VER(dev_priv) == 2)
|
||||
return 128;
|
||||
else
|
||||
return 512;
|
||||
case I915_FORMAT_MOD_Y_TILED_CCS:
|
||||
if (is_ccs_plane(fb, color_plane))
|
||||
return 128;
|
||||
fallthrough;
|
||||
case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS:
|
||||
case I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC:
|
||||
case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
|
||||
if (is_ccs_plane(fb, color_plane))
|
||||
return 64;
|
||||
fallthrough;
|
||||
case I915_FORMAT_MOD_Y_TILED:
|
||||
if (DISPLAY_VER(dev_priv) == 2 || HAS_128_BYTE_Y_TILING(dev_priv))
|
||||
return 128;
|
||||
else
|
||||
return 512;
|
||||
case I915_FORMAT_MOD_Yf_TILED_CCS:
|
||||
if (is_ccs_plane(fb, color_plane))
|
||||
return 128;
|
||||
fallthrough;
|
||||
case I915_FORMAT_MOD_Yf_TILED:
|
||||
switch (cpp) {
|
||||
case 1:
|
||||
return 64;
|
||||
case 2:
|
||||
case 4:
|
||||
return 128;
|
||||
case 8:
|
||||
case 16:
|
||||
return 256;
|
||||
default:
|
||||
MISSING_CASE(cpp);
|
||||
return cpp;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
MISSING_CASE(fb->modifier);
|
||||
return cpp;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int intel_tile_height(const struct drm_framebuffer *fb, int color_plane)
|
||||
{
|
||||
if (is_gen12_ccs_plane(fb, color_plane))
|
||||
|
|
|
@ -28,6 +28,7 @@ int skl_ccs_to_main_plane(const struct drm_framebuffer *fb, int ccs_plane);
|
|||
int skl_main_to_aux_plane(const struct drm_framebuffer *fb, int main_plane);
|
||||
|
||||
unsigned int intel_tile_size(const struct drm_i915_private *i915);
|
||||
unsigned int intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane);
|
||||
unsigned int intel_tile_height(const struct drm_framebuffer *fb, int color_plane);
|
||||
unsigned int intel_tile_row_size(const struct drm_framebuffer *fb, int color_plane);
|
||||
|
||||
|
|
Loading…
Reference in New Issue