[Intel-gfx] [RFC PATCH 2/7] drm/i915: Read hw state into an atomic state struct, try 2.

Daniel Stone daniel at fooishbar.org
Fri Jun 19 02:38:40 PDT 2015


Hi,

On 19 June 2015 at 09:02, Maarten Lankhorst
<maarten.lankhorst at linux.intel.com> wrote:
> +               if (crtc->state->enable) {
> +                       intel_mode_from_pipe_config(&crtc->mode,
> +                               to_intel_crtc_state(crtc->state));
> +                       intel_mode_from_pipe_config(&crtc->state->adjusted_mode,
> +                               to_intel_crtc_state(crtc->state));
> +
> +                       if (drm_atomic_set_mode_for_crtc(crtc->state, &crtc->mode) < 0)
> +                               drm_mode_copy(&crtc->state->mode, &crtc->mode);

I've never really understood why this is here. There are only two ways
in which set_mode_for_crtc can fail: either the mode fails validation
(fixed in the patch I sent you the other day, which it seems like
you've now pulled in), or -ENOMEM. The first one we shouldn't really
be papering over - and I haven't seen it happen since that patch - and
the second one isn't really recoverable anyway. Plus I would argue
that breaking the state like that is pretty bad.

Cheers,
Daniel


More information about the Intel-gfx mailing list