drm/radeon/kms: r600 fix color buffer pitch check
Subsystems (2)
PATCH 1/1 drm/radeon/kms: r600 fix color buffer pitch check
Color buffer pitch need to be 64bits aligned not 64bytes. This patch correct the cs checker.
--- drivers/gpu/drm/radeon/r600_cs.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +4 -4
@@ -193,14 +193,14 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)switch (G_0280A0_ARRAY_MODE (track->cb_color_info[i])) {case V_0280A0_ARRAY_LINEAR_GENERAL :case V_0280A0_ARRAY_LINEAR_ALIGNED : -if (pitch &0x3f ) { +if (pitch &0x3 ) {dev_warn (p->dev,"%s:%d cb pitch (%d x %d = %d) invalid\n" , __func__, __LINE__, pitch, bpe, pitch * bpe);return -EINVAL ; } -if ((pitch * bpe) & (track->group_size -1 )) { -dev_warn (p->dev,"%s:%d cb pitch (%d) invalid\n" , - __func__, __LINE__, pitch); +if ((pitch * bpe *8 ) & (track->group_size -1 )) { +dev_warn (p->dev,"%s:%d cb pitch (%d x %d = %d) %d invalid\n" , + __func__, __LINE__, pitch, bpe, pitch * bpe, track->group_size);return -EINVAL ; }break ;
Signature · 1 line
1.7.0.1
Quoted 3 lines · Jerome Glisse
Color buffer pitch need to be 64bits aligned not 64bytes. This patch correct the cs checker.
Nack for now. It's actually quite a bit more complex. I'll try and put together some better info on the alignment requirements tomorrow.
Alex
Quoted 37 lines
Signed-off-by Jerome Glisse <[email protected]>Cc stable <[email protected]>---
drivers/gpu/drm/radeon/r600_cs.c | 8 ++++----1 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/radeon/r600_cs.c +0
-0@@ -193,14 +193,14 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) switch (G_0280A0_ARRAY_MODE(track->cb_color_info[i])) {case
V_0280A0_ARRAY_LINEAR_GENERAL:
caseV_0280A0_ARRAY_LINEAR_ALIGNED:
- if (pitch &0x3f) {
+ if (pitch &0x3) {
dev_warn(p->dev, "%s:%d cb pitch (%d x %d = %d) invalid\n",__func__,__LINE__, pitch, bpe, pitch * bpe); return-EINVAL;
}
- if ((pitch * bpe) & (track->group_size- 1)) {
- dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
-__func__,__LINE__, pitch);
+ if ((pitch * bpe * 8) & (track->group_size- 1)) {
+ dev_warn(p->dev, "%s:%d cb pitch (%d x %d = %d) %d invalid\n",
+__func__,__LINE__, pitch, bpe, pitch * bpe,track->group_size); return-EINVAL;
}
break;
--
1.7.0.1_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel