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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 4, 2013 at 9:42 PM, Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx>

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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux