diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_atomic_plane.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_atomic_plane.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c index fa7df5fe154b..aabebe0d2e9b 100644 --- a/drivers/gpu/drm/i915/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c | |||
@@ -113,71 +113,18 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ | |||
113 | struct intel_plane_state *intel_state) | 113 | struct intel_plane_state *intel_state) |
114 | { | 114 | { |
115 | struct drm_plane *plane = intel_state->base.plane; | 115 | struct drm_plane *plane = intel_state->base.plane; |
116 | struct drm_i915_private *dev_priv = to_i915(plane->dev); | ||
117 | struct drm_plane_state *state = &intel_state->base; | 116 | struct drm_plane_state *state = &intel_state->base; |
118 | struct intel_plane *intel_plane = to_intel_plane(plane); | 117 | struct intel_plane *intel_plane = to_intel_plane(plane); |
119 | const struct drm_display_mode *adjusted_mode = | ||
120 | &crtc_state->base.adjusted_mode; | ||
121 | int ret; | 118 | int ret; |
122 | 119 | ||
123 | if (!intel_state->base.crtc && !old_plane_state->base.crtc) | 120 | if (!intel_state->base.crtc && !old_plane_state->base.crtc) |
124 | return 0; | 121 | return 0; |
125 | 122 | ||
126 | if (state->fb && drm_rotation_90_or_270(state->rotation)) { | ||
127 | struct drm_format_name_buf format_name; | ||
128 | |||
129 | if (state->fb->modifier != I915_FORMAT_MOD_Y_TILED && | ||
130 | state->fb->modifier != I915_FORMAT_MOD_Yf_TILED) { | ||
131 | DRM_DEBUG_KMS("Y/Yf tiling required for 90/270!\n"); | ||
132 | return -EINVAL; | ||
133 | } | ||
134 | |||
135 | /* | ||
136 | * 90/270 is not allowed with RGB64 16:16:16:16, | ||
137 | * RGB 16-bit 5:6:5, and Indexed 8-bit. | ||
138 | * TBD: Add RGB64 case once its added in supported format list. | ||
139 | */ | ||
140 | switch (state->fb->format->format) { | ||
141 | case DRM_FORMAT_C8: | ||
142 | case DRM_FORMAT_RGB565: | ||
143 | DRM_DEBUG_KMS("Unsupported pixel format %s for 90/270!\n", | ||
144 | drm_get_format_name(state->fb->format->format, | ||
145 | &format_name)); | ||
146 | return -EINVAL; | ||
147 | |||
148 | default: | ||
149 | break; | ||
150 | } | ||
151 | } | ||
152 | |||
153 | /* CHV ignores the mirror bit when the rotate bit is set :( */ | ||
154 | if (IS_CHERRYVIEW(dev_priv) && | ||
155 | state->rotation & DRM_MODE_ROTATE_180 && | ||
156 | state->rotation & DRM_MODE_REFLECT_X) { | ||
157 | DRM_DEBUG_KMS("Cannot rotate and reflect at the same time\n"); | ||
158 | return -EINVAL; | ||
159 | } | ||
160 | |||
161 | intel_state->base.visible = false; | 123 | intel_state->base.visible = false; |
162 | ret = intel_plane->check_plane(crtc_state, intel_state); | 124 | ret = intel_plane->check_plane(crtc_state, intel_state); |
163 | if (ret) | 125 | if (ret) |
164 | return ret; | 126 | return ret; |
165 | 127 | ||
166 | /* | ||
167 | * Y-tiling is not supported in IF-ID Interlace mode in | ||
168 | * GEN9 and above. | ||
169 | */ | ||
170 | if (state->fb && INTEL_GEN(dev_priv) >= 9 && crtc_state->base.enable && | ||
171 | adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) { | ||
172 | if (state->fb->modifier == I915_FORMAT_MOD_Y_TILED || | ||
173 | state->fb->modifier == I915_FORMAT_MOD_Yf_TILED || | ||
174 | state->fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS || | ||
175 | state->fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS) { | ||
176 | DRM_DEBUG_KMS("Y/Yf tiling not supported in IF-ID mode\n"); | ||
177 | return -EINVAL; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | /* FIXME pre-g4x don't work like this */ | 128 | /* FIXME pre-g4x don't work like this */ |
182 | if (state->visible) | 129 | if (state->visible) |
183 | crtc_state->active_planes |= BIT(intel_plane->id); | 130 | crtc_state->active_planes |= BIT(intel_plane->id); |