| summaryrefslogtreecommitdiff |
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-12 18:35:38 (GMT) |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 18:09:22 (GMT) |
| commit | 4060b482bfb832715e43695e124031bede63be75 (patch) (unidiff) | |
| tree | 6125792ca44a6b2388ce42c68ae6f3652c13e653 | |
| parent | 5078304217e1e87bc7ffe8d7a4076e4cb0c0a318 (diff) | |
drm/i915: Check overlay stride errata for i830 and i845
commit a1efd14a99483a4fb9308902397ed86b69454c99 upstream.
Apparently i830 and i845 cannot handle any stride that is not a multiple
of 256, unlike their brethren which do support 64 byte aligned strides.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| -rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index d7ad513..fe05ba2 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
| @@ -955,13 +955,13 @@ static int check_overlay_src(struct drm_device *dev, | |||
| 955 | } | 955 | } |
| 956 | /* better safe than sorry, use 4 as the maximal subsampling ratio */ | 956 | /* better safe than sorry, use 4 as the maximal subsampling ratio */ |
| 957 | if (rec->src_height < N_VERT_Y_TAPS*4 | 957 | if (rec->src_height < N_VERT_Y_TAPS*4 |
| 958 | || rec->src_width < N_HORIZ_Y_TAPS*4) | 958 | || rec->src_width < N_HORIZ_Y_TAPS*4) |
| 959 | return -EINVAL; | 959 | return -EINVAL; |
| 960 | 960 | ||
| 961 | /* check alingment constrains */ | 961 | /* check alignment constraints */ |
| 962 | switch (rec->flags & I915_OVERLAY_TYPE_MASK) { | 962 | switch (rec->flags & I915_OVERLAY_TYPE_MASK) { |
| 963 | case I915_OVERLAY_RGB: | 963 | case I915_OVERLAY_RGB: |
| 964 | /* not implemented */ | 964 | /* not implemented */ |
| 965 | return -EINVAL; | 965 | return -EINVAL; |
| 966 | case I915_OVERLAY_YUV_PACKED: | 966 | case I915_OVERLAY_YUV_PACKED: |
| 967 | depth = packed_depth_bytes(rec->flags); | 967 | depth = packed_depth_bytes(rec->flags); |
| @@ -987,12 +987,15 @@ static int check_overlay_src(struct drm_device *dev, | |||
| 987 | } | 987 | } |
| 988 | 988 | ||
| 989 | if (rec->src_width % uv_hscale) | 989 | if (rec->src_width % uv_hscale) |
| 990 | return -EINVAL; | 990 | return -EINVAL; |
| 991 | 991 | ||
| 992 | /* stride checking */ | 992 | /* stride checking */ |
| 993 | if (IS_I830(dev) || IS_845G(dev)) | ||
| 994 | stride_mask = 255; | ||
| 995 | else | ||
| 993 | stride_mask = 63; | 996 | stride_mask = 63; |
| 994 | 997 | ||
| 995 | if (rec->stride_Y & stride_mask || rec->stride_UV & stride_mask) | 998 | if (rec->stride_Y & stride_mask || rec->stride_UV & stride_mask) |
| 996 | return -EINVAL; | 999 | return -EINVAL; |
| 997 | if (IS_I965G(dev) && rec->stride_Y < 512) | 1000 | if (IS_I965G(dev) && rec->stride_Y < 512) |
| 998 | return -EINVAL; | 1001 | return -EINVAL; |