diff options
author | Keith Packard <keithp@keithp.com> | 2011-09-05 14:53:21 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-09-19 21:02:51 -0400 |
commit | 7cd015a0a37265e23bbdce7ce8f7e00507abe9ed (patch) | |
tree | 0abfb84a29cdc757d90a38abe3f07324e40421ff | |
parent | b6fd41e29dea9c6753b1843a77e50433e6123bcb (diff) |
drm/i915: Enable dither whenever display bpc < frame buffer bpc
We want to enable dithering on any pipe where the frame buffer has
more color resolution than the output device.
The previous code was incorrectly clamping the frame buffer bpc to the
display bpc, effectively disabling dithering all of the time as the
computed frame buffer bpc would never be larger than the display bpc.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reported-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 56a8554d9039..9fb4a40bd9e5 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4687,13 +4687,13 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | |||
4687 | bpc = 6; /* min is 18bpp */ | 4687 | bpc = 6; /* min is 18bpp */ |
4688 | break; | 4688 | break; |
4689 | case 24: | 4689 | case 24: |
4690 | bpc = min((unsigned int)8, display_bpc); | 4690 | bpc = 8; |
4691 | break; | 4691 | break; |
4692 | case 30: | 4692 | case 30: |
4693 | bpc = min((unsigned int)10, display_bpc); | 4693 | bpc = 10; |
4694 | break; | 4694 | break; |
4695 | case 48: | 4695 | case 48: |
4696 | bpc = min((unsigned int)12, display_bpc); | 4696 | bpc = 12; |
4697 | break; | 4697 | break; |
4698 | default: | 4698 | default: |
4699 | DRM_DEBUG("unsupported depth, assuming 24 bits\n"); | 4699 | DRM_DEBUG("unsupported depth, assuming 24 bits\n"); |
@@ -4701,10 +4701,12 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | |||
4701 | break; | 4701 | break; |
4702 | } | 4702 | } |
4703 | 4703 | ||
4704 | display_bpc = min(display_bpc, bpc); | ||
4705 | |||
4704 | DRM_DEBUG_DRIVER("setting pipe bpc to %d (max display bpc %d)\n", | 4706 | DRM_DEBUG_DRIVER("setting pipe bpc to %d (max display bpc %d)\n", |
4705 | bpc, display_bpc); | 4707 | bpc, display_bpc); |
4706 | 4708 | ||
4707 | *pipe_bpp = bpc * 3; | 4709 | *pipe_bpp = display_bpc * 3; |
4708 | 4710 | ||
4709 | return display_bpc != bpc; | 4711 | return display_bpc != bpc; |
4710 | } | 4712 | } |