drm/i915: Fix RC6VIDS encode/decode
authorBen Widawsky <ben@bwidawsk.net>
Sat, 2 Feb 2013 00:41:14 +0000 (16:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2013 13:38:36 +0000 (05:38 -0800)
commit1963d1f0a223d134186ea6c2b5540e981408d458
treebc14a2625f387f3953bf8150d1ae1de5839c266b
parent93acc1b01987426940bc8403aea19e13e13da421
drm/i915: Fix RC6VIDS encode/decode

commit 7083e05072b88d503d257b6f012ce56367f3ac97 upstream.

The RC6 VIDS has a linear ramp starting at 250mv, which means any values
below 250 are invalid. The old buggy macros tried to adjust for this to
be more flexible, but there is no need. As Dan pointed out the ENCODE
only ever has one value. The only invalid value for decode is an input
of 0 which means something is really wonky, and the cases where DECODE
are used either don't matter (debug values), or would be implicitly
correct (the check for less than 450).

This patch makes simpler, easier to read macros which are actually
correct. Maybe this patch can actually fix some bugs now.

Thanks to Dan for catching this. /me hides

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/i915_reg.h