[Intel-gfx] [PATCH 1/2] drm/i915: make backlight functions take a connector v2

Daniel Vetter daniel at ffwll.ch
Sat Oct 5 13:04:08 CEST 2013

On Fri, Oct 4, 2013 at 9:42 PM, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> On VLV/BYT, backlight controls a per-pipe, so when adjusting the
> backlight we need to pass the correct info.  So make the externally
> visible backlight functions take a connector argument, which can be used
> internally to figure out the pipe backlight to adjust.
> v2: make connector pipe lookup check for NULL crtc (Jani)
>     fixup connector check in ASLE code (Jani)
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

To high-level things that we need to figure out first:

1. You're connector->pipe chasing is buggy. You shouldn't chase
intel_connector->encoder since for shared encoders this doesn't
reflect whether the connector is actually connected to that encoder.
Instead check intel_connector->base.encoder for non-NULL, which
guarantees you that you also have a valid crtc. Then getting at the
pipe is simple:

pipe = to_intel_crtc(intel_connector->base.encoder->crtc);

so I think we can also ditch your little helper and PIPE_INVALID
(which is good, since otherwise I'll volunteer your for a follow-up
patch to use PIPE_INVALID at a bunch more places ...).

2. You can only chase the above pointers if you have the big modeset
lock locked. Which at least for the functions implementing the
backlight sysfs interface seems to not be the case.

Cheers, Daniel
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

More information about the Intel-gfx mailing list