[Intel-gfx] [PATCH 1/2] drm/i915: Abstract backlight registers a bit

Daniel Vetter daniel at ffwll.ch
Tue Oct 22 01:57:24 CEST 2013


On Tue, Oct 22, 2013 at 12:48 AM, Ben Widawsky <ben at bwidawsk.net> wrote:
> On Tue, Oct 22, 2013 at 12:30:11AM +0200, Daniel Vetter wrote:
>> On Mon, Oct 21, 2013 at 7:35 PM, Ben Widawsky
>> <benjamin.widawsky at intel.com> wrote:
>> > Many GENs generally perform the same actions just on different
>> > registers. This is true going forward as well. To ease the transition a
>> > bit, extract the common code where possible.
>> >
>> > Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
>>
>> Imo we should just switch to vtables or something like that, since
>> it's not just the register that changes, but also the meaning of the
>> different bits in the registers themselves and the logic to drive
>> stuff. We've often had regression-galore in this code and strictly
>> separating different platforms should help. I hope.
>> -Daniel
>
> I do not disagree. I have neither the skill, time, not inclination to do
> that properly, and I really only care about patch 2. The cleanup here
> makes the next patch slightly nicer, but I can live with whatever.

Personally I vote to keep the ugliness here until someone is fed up
and cleans it up for good. Jesse's looking ripe for it, especially
since vlv has this new need for a pipe parameter added to the
backlight code. So for now I'd just add another if clause all over and
copy-paste the existing code for the 2nd patch for -internal.
-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