diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4f0675460336..3b56b2cae804 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -2455,7 +2455,7 @@ u32 intel_compute_tile_offset(int *x, int *y, | |||
| 2455 | u32 alignment; | 2455 | u32 alignment; |
| 2456 | 2456 | ||
| 2457 | /* AUX_DIST needs only 4K alignment */ | 2457 | /* AUX_DIST needs only 4K alignment */ |
| 2458 | if (fb->pixel_format == DRM_FORMAT_NV12 && plane == 1) | 2458 | if (fb->format->format == DRM_FORMAT_NV12 && plane == 1) |
| 2459 | alignment = 4096; | 2459 | alignment = 4096; |
| 2460 | else | 2460 | else |
| 2461 | alignment = intel_surf_alignment(dev_priv, fb->modifier); | 2461 | alignment = intel_surf_alignment(dev_priv, fb->modifier); |
| @@ -2700,7 +2700,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc, | |||
| 2700 | if (plane_config->tiling == I915_TILING_X) | 2700 | if (plane_config->tiling == I915_TILING_X) |
| 2701 | obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X; | 2701 | obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X; |
| 2702 | 2702 | ||
| 2703 | mode_cmd.pixel_format = fb->pixel_format; | 2703 | mode_cmd.pixel_format = fb->format->format; |
| 2704 | mode_cmd.width = fb->width; | 2704 | mode_cmd.width = fb->width; |
| 2705 | mode_cmd.height = fb->height; | 2705 | mode_cmd.height = fb->height; |
| 2706 | mode_cmd.pitches[0] = fb->pitches[0]; | 2706 | mode_cmd.pitches[0] = fb->pitches[0]; |
| @@ -2976,7 +2976,7 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state) | |||
| 2976 | * Handle the AUX surface first since | 2976 | * Handle the AUX surface first since |
| 2977 | * the main surface setup depends on it. | 2977 | * the main surface setup depends on it. |
| 2978 | */ | 2978 | */ |
| 2979 | if (fb->pixel_format == DRM_FORMAT_NV12) { | 2979 | if (fb->format->format == DRM_FORMAT_NV12) { |
| 2980 | ret = skl_check_nv12_aux_surface(plane_state); | 2980 | ret = skl_check_nv12_aux_surface(plane_state); |
| 2981 | if (ret) | 2981 | if (ret) |
| 2982 | return ret; | 2982 | return ret; |
| @@ -3031,7 +3031,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, | |||
| 3031 | I915_WRITE(PRIMCNSTALPHA(plane), 0); | 3031 | I915_WRITE(PRIMCNSTALPHA(plane), 0); |
| 3032 | } | 3032 | } |
| 3033 | 3033 | ||
| 3034 | switch (fb->pixel_format) { | 3034 | switch (fb->format->format) { |
| 3035 | case DRM_FORMAT_C8: | 3035 | case DRM_FORMAT_C8: |
| 3036 | dspcntr |= DISPPLANE_8BPP; | 3036 | dspcntr |= DISPPLANE_8BPP; |
| 3037 | break; | 3037 | break; |
| @@ -3146,7 +3146,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary, | |||
| 3146 | if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) | 3146 | if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) |
| 3147 | dspcntr |= DISPPLANE_PIPE_CSC_ENABLE; | 3147 | dspcntr |= DISPPLANE_PIPE_CSC_ENABLE; |
| 3148 | 3148 | ||
| 3149 | switch (fb->pixel_format) { | 3149 | switch (fb->format->format) { |
| 3150 | case DRM_FORMAT_C8: | 3150 | case DRM_FORMAT_C8: |
| 3151 | dspcntr |= DISPPLANE_8BPP; | 3151 | dspcntr |= DISPPLANE_8BPP; |
| 3152 | break; | 3152 | break; |
| @@ -3282,7 +3282,7 @@ u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane, | |||
| 3282 | stride /= intel_tile_height(dev_priv, fb->modifier, cpp); | 3282 | stride /= intel_tile_height(dev_priv, fb->modifier, cpp); |
| 3283 | } else { | 3283 | } else { |
| 3284 | stride /= intel_fb_stride_alignment(dev_priv, fb->modifier, | 3284 | stride /= intel_fb_stride_alignment(dev_priv, fb->modifier, |
| 3285 | fb->pixel_format); | 3285 | fb->format->format); |
| 3286 | } | 3286 | } |
| 3287 | 3287 | ||
| 3288 | return stride; | 3288 | return stride; |
| @@ -3396,7 +3396,7 @@ static void skylake_update_primary_plane(struct drm_plane *plane, | |||
| 3396 | PLANE_CTL_PIPE_GAMMA_ENABLE | | 3396 | PLANE_CTL_PIPE_GAMMA_ENABLE | |
| 3397 | PLANE_CTL_PIPE_CSC_ENABLE; | 3397 | PLANE_CTL_PIPE_CSC_ENABLE; |
| 3398 | 3398 | ||
| 3399 | plane_ctl |= skl_plane_ctl_format(fb->pixel_format); | 3399 | plane_ctl |= skl_plane_ctl_format(fb->format->format); |
| 3400 | plane_ctl |= skl_plane_ctl_tiling(fb->modifier); | 3400 | plane_ctl |= skl_plane_ctl_tiling(fb->modifier); |
| 3401 | plane_ctl |= PLANE_CTL_PLANE_GAMMA_DISABLE; | 3401 | plane_ctl |= PLANE_CTL_PLANE_GAMMA_DISABLE; |
| 3402 | plane_ctl |= skl_plane_ctl_rotation(rotation); | 3402 | plane_ctl |= skl_plane_ctl_rotation(rotation); |
| @@ -4768,7 +4768,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state, | |||
| 4768 | } | 4768 | } |
| 4769 | 4769 | ||
| 4770 | /* Check src format */ | 4770 | /* Check src format */ |
| 4771 | switch (fb->pixel_format) { | 4771 | switch (fb->format->format) { |
| 4772 | case DRM_FORMAT_RGB565: | 4772 | case DRM_FORMAT_RGB565: |
| 4773 | case DRM_FORMAT_XBGR8888: | 4773 | case DRM_FORMAT_XBGR8888: |
| 4774 | case DRM_FORMAT_XRGB8888: | 4774 | case DRM_FORMAT_XRGB8888: |
| @@ -4784,7 +4784,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state, | |||
| 4784 | default: | 4784 | default: |
| 4785 | DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n", | 4785 | DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n", |
| 4786 | intel_plane->base.base.id, intel_plane->base.name, | 4786 | intel_plane->base.base.id, intel_plane->base.name, |
| 4787 | fb->base.id, fb->pixel_format); | 4787 | fb->base.id, fb->format->format); |
| 4788 | return -EINVAL; | 4788 | return -EINVAL; |
| 4789 | } | 4789 | } |
| 4790 | 4790 | ||
| @@ -8714,7 +8714,6 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 8714 | 8714 | ||
| 8715 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; | 8715 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; |
| 8716 | fourcc = i9xx_format_to_fourcc(pixel_format); | 8716 | fourcc = i9xx_format_to_fourcc(pixel_format); |
| 8717 | fb->pixel_format = fourcc; | ||
| 8718 | fb->format = drm_format_info(fourcc); | 8717 | fb->format = drm_format_info(fourcc); |
| 8719 | 8718 | ||
| 8720 | if (INTEL_GEN(dev_priv) >= 4) { | 8719 | if (INTEL_GEN(dev_priv) >= 4) { |
| @@ -8736,7 +8735,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 8736 | fb->pitches[0] = val & 0xffffffc0; | 8735 | fb->pitches[0] = val & 0xffffffc0; |
| 8737 | 8736 | ||
| 8738 | aligned_height = intel_fb_align_height(dev, fb->height, | 8737 | aligned_height = intel_fb_align_height(dev, fb->height, |
| 8739 | fb->pixel_format, | 8738 | fb->format->format, |
| 8740 | fb->modifier); | 8739 | fb->modifier); |
| 8741 | 8740 | ||
| 8742 | plane_config->size = fb->pitches[0] * aligned_height; | 8741 | plane_config->size = fb->pitches[0] * aligned_height; |
| @@ -9745,7 +9744,6 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 9745 | fourcc = skl_format_to_fourcc(pixel_format, | 9744 | fourcc = skl_format_to_fourcc(pixel_format, |
| 9746 | val & PLANE_CTL_ORDER_RGBX, | 9745 | val & PLANE_CTL_ORDER_RGBX, |
| 9747 | val & PLANE_CTL_ALPHA_MASK); | 9746 | val & PLANE_CTL_ALPHA_MASK); |
| 9748 | fb->pixel_format = fourcc; | ||
| 9749 | fb->format = drm_format_info(fourcc); | 9747 | fb->format = drm_format_info(fourcc); |
| 9750 | 9748 | ||
| 9751 | tiling = val & PLANE_CTL_TILED_MASK; | 9749 | tiling = val & PLANE_CTL_TILED_MASK; |
| @@ -9779,11 +9777,11 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 9779 | 9777 | ||
| 9780 | val = I915_READ(PLANE_STRIDE(pipe, 0)); | 9778 | val = I915_READ(PLANE_STRIDE(pipe, 0)); |
| 9781 | stride_mult = intel_fb_stride_alignment(dev_priv, fb->modifier, | 9779 | stride_mult = intel_fb_stride_alignment(dev_priv, fb->modifier, |
| 9782 | fb->pixel_format); | 9780 | fb->format->format); |
| 9783 | fb->pitches[0] = (val & 0x3ff) * stride_mult; | 9781 | fb->pitches[0] = (val & 0x3ff) * stride_mult; |
| 9784 | 9782 | ||
| 9785 | aligned_height = intel_fb_align_height(dev, fb->height, | 9783 | aligned_height = intel_fb_align_height(dev, fb->height, |
| 9786 | fb->pixel_format, | 9784 | fb->format->format, |
| 9787 | fb->modifier); | 9785 | fb->modifier); |
| 9788 | 9786 | ||
| 9789 | plane_config->size = fb->pitches[0] * aligned_height; | 9787 | plane_config->size = fb->pitches[0] * aligned_height; |
| @@ -9860,7 +9858,6 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 9860 | 9858 | ||
| 9861 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; | 9859 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; |
| 9862 | fourcc = i9xx_format_to_fourcc(pixel_format); | 9860 | fourcc = i9xx_format_to_fourcc(pixel_format); |
| 9863 | fb->pixel_format = fourcc; | ||
| 9864 | fb->format = drm_format_info(fourcc); | 9861 | fb->format = drm_format_info(fourcc); |
| 9865 | 9862 | ||
| 9866 | base = I915_READ(DSPSURF(pipe)) & 0xfffff000; | 9863 | base = I915_READ(DSPSURF(pipe)) & 0xfffff000; |
| @@ -9882,7 +9879,7 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc, | |||
| 9882 | fb->pitches[0] = val & 0xffffffc0; | 9879 | fb->pitches[0] = val & 0xffffffc0; |
| 9883 | 9880 | ||
| 9884 | aligned_height = intel_fb_align_height(dev, fb->height, | 9881 | aligned_height = intel_fb_align_height(dev, fb->height, |
| 9885 | fb->pixel_format, | 9882 | fb->format->format, |
| 9886 | fb->modifier); | 9883 | fb->modifier); |
| 9887 | 9884 | ||
| 9888 | plane_config->size = fb->pitches[0] * aligned_height; | 9885 | plane_config->size = fb->pitches[0] * aligned_height; |
| @@ -12150,7 +12147,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
| 12150 | return -EBUSY; | 12147 | return -EBUSY; |
| 12151 | 12148 | ||
| 12152 | /* Can't change pixel format via MI display flips. */ | 12149 | /* Can't change pixel format via MI display flips. */ |
| 12153 | if (fb->pixel_format != crtc->primary->fb->pixel_format) | 12150 | if (fb->format->format != crtc->primary->fb->format->format) |
| 12154 | return -EINVAL; | 12151 | return -EINVAL; |
| 12155 | 12152 | ||
| 12156 | /* | 12153 | /* |
| @@ -12847,7 +12844,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, | |||
| 12847 | DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d, fb = %ux%u format = %s\n", | 12844 | DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d, fb = %ux%u format = %s\n", |
| 12848 | plane->base.id, plane->name, | 12845 | plane->base.id, plane->name, |
| 12849 | fb->base.id, fb->width, fb->height, | 12846 | fb->base.id, fb->width, fb->height, |
| 12850 | drm_get_format_name(fb->pixel_format, &format_name)); | 12847 | drm_get_format_name(fb->format->format, &format_name)); |
| 12851 | if (INTEL_GEN(dev_priv) >= 9) | 12848 | if (INTEL_GEN(dev_priv) >= 9) |
| 12852 | DRM_DEBUG_KMS("\tscaler:%d src %dx%d+%d+%d dst %dx%d+%d+%d\n", | 12849 | DRM_DEBUG_KMS("\tscaler:%d src %dx%d+%d+%d dst %dx%d+%d+%d\n", |
| 12853 | state->scaler_id, | 12850 | state->scaler_id, |
