diff options
author | Adam Jackson <ajax@redhat.com> | 2010-04-19 15:57:25 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-05-07 16:59:26 -0400 |
commit | 0a31a448659d48cbc38f5e7520d8a65f8f1f8276 (patch) | |
tree | d02870a48aaf5669a95906948bdfbc175bad45f1 /drivers | |
parent | 9e51159c14c29ebd485a45ba56f148e180d62c29 (diff) |
drm/i915: Use spatio-temporal dithering on PCH
Spatial dither is better than nothing, but ST is even better.
(from ajax's followup message:)
I noticed this with:
http://ajax.fedorapeople.org/YellowFlower.jpg
set as my desktop background in Gnome on a 1280x800 machine (in
particular, a Sony Vaio VPCB1 with 6-bit panel and a rather bright black
level). Easiest way to test this is by poking at PIPEACONF with
intel_reg_write directly:
% sudo intel_reg_write 0x70008 0xc0000040 # no dither
% sudo intel_reg_write 0x70008 0xc0000050 # spatial
% sudo intel_reg_write 0x70008 0xc0000054 # ST
I notice it especially strongly in the relatively flat dark area in the
top left. Closer than about 18" I can see a noticeable checkerboard
pattern with plain spatial dithering. ST smooths that out; I can still
tell that it's lacking color precision, but it's not offensive.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 527d30aecda2..0bbbb7753950 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -1922,7 +1922,10 @@ | |||
1922 | /* Display & cursor control */ | 1922 | /* Display & cursor control */ |
1923 | 1923 | ||
1924 | /* dithering flag on Ironlake */ | 1924 | /* dithering flag on Ironlake */ |
1925 | #define PIPE_ENABLE_DITHER (1 << 4) | 1925 | #define PIPE_ENABLE_DITHER (1 << 4) |
1926 | #define PIPE_DITHER_TYPE_MASK (3 << 2) | ||
1927 | #define PIPE_DITHER_TYPE_SPATIAL (0 << 2) | ||
1928 | #define PIPE_DITHER_TYPE_ST01 (1 << 2) | ||
1926 | /* Pipe A */ | 1929 | /* Pipe A */ |
1927 | #define PIPEADSL 0x70000 | 1930 | #define PIPEADSL 0x70000 |
1928 | #define PIPEACONF 0x70008 | 1931 | #define PIPEACONF 0x70008 |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3836f56e842c..119a41ac3bb6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3677,14 +3677,16 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3677 | /* set the dithering flag */ | 3677 | /* set the dithering flag */ |
3678 | if (IS_I965G(dev)) { | 3678 | if (IS_I965G(dev)) { |
3679 | if (dev_priv->lvds_dither) { | 3679 | if (dev_priv->lvds_dither) { |
3680 | if (HAS_PCH_SPLIT(dev)) | 3680 | if (HAS_PCH_SPLIT(dev)) { |
3681 | pipeconf |= PIPE_ENABLE_DITHER; | 3681 | pipeconf |= PIPE_ENABLE_DITHER; |
3682 | else | 3682 | pipeconf |= PIPE_DITHER_TYPE_ST01; |
3683 | } else | ||
3683 | lvds |= LVDS_ENABLE_DITHER; | 3684 | lvds |= LVDS_ENABLE_DITHER; |
3684 | } else { | 3685 | } else { |
3685 | if (HAS_PCH_SPLIT(dev)) | 3686 | if (HAS_PCH_SPLIT(dev)) { |
3686 | pipeconf &= ~PIPE_ENABLE_DITHER; | 3687 | pipeconf &= ~PIPE_ENABLE_DITHER; |
3687 | else | 3688 | pipeconf &= ~PIPE_DITHER_TYPE_MASK; |
3689 | } else | ||
3688 | lvds &= ~LVDS_ENABLE_DITHER; | 3690 | lvds &= ~LVDS_ENABLE_DITHER; |
3689 | } | 3691 | } |
3690 | } | 3692 | } |