diff options
author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2015-03-20 10:18:09 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-26 12:49:53 -0400 |
commit | 1486017fbfef5441cc61c805ccace4d3dea27c80 (patch) | |
tree | 5a8a779b600b819d95110b801c3001ae6e4158ab /drivers/gpu/drm/i915/intel_display.c | |
parent | 0b9018793939970aad49e4e0ed21f0fd0db74e4a (diff) |
drm/i915: Don't use encoder->new_crtc in compute_baseline_pipe_bpp()
Move towards atomic by using the legacy modeset's drm_atomic_state
instead.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
[danvet: Keep the if (!connector) continue; separate so that it's
easier to eventually extract a for_each_connector_in_state iterator.
And because of the upcast it's also safer.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index afceb5836af7..034aa7e8e683 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -10319,8 +10319,9 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc, | |||
10319 | struct intel_crtc_state *pipe_config) | 10319 | struct intel_crtc_state *pipe_config) |
10320 | { | 10320 | { |
10321 | struct drm_device *dev = crtc->base.dev; | 10321 | struct drm_device *dev = crtc->base.dev; |
10322 | struct drm_atomic_state *state; | ||
10322 | struct intel_connector *connector; | 10323 | struct intel_connector *connector; |
10323 | int bpp; | 10324 | int bpp, i; |
10324 | 10325 | ||
10325 | switch (fb->pixel_format) { | 10326 | switch (fb->pixel_format) { |
10326 | case DRM_FORMAT_C8: | 10327 | case DRM_FORMAT_C8: |
@@ -10360,10 +10361,15 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc, | |||
10360 | 10361 | ||
10361 | pipe_config->pipe_bpp = bpp; | 10362 | pipe_config->pipe_bpp = bpp; |
10362 | 10363 | ||
10364 | state = pipe_config->base.state; | ||
10365 | |||
10363 | /* Clamp display bpp to EDID value */ | 10366 | /* Clamp display bpp to EDID value */ |
10364 | for_each_intel_connector(dev, connector) { | 10367 | for (i = 0; i < state->num_connector; i++) { |
10365 | if (!connector->new_encoder || | 10368 | if (!state->connectors[i]) |
10366 | connector->new_encoder->new_crtc != crtc) | 10369 | continue; |
10370 | |||
10371 | connector = to_intel_connector(state->connectors[i]); | ||
10372 | if (state->connector_states[i]->crtc != &crtc->base) | ||
10367 | continue; | 10373 | continue; |
10368 | 10374 | ||
10369 | connected_sink_compute_bpp(connector, pipe_config); | 10375 | connected_sink_compute_bpp(connector, pipe_config); |