diff mbox

drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID

Message ID 1389201386-30126-1-git-send-email-maraeo@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marek Olšák Jan. 8, 2014, 5:16 p.m. UTC
From: Marek Olšák <marek.olsak@amd.com>

This fixes a bug which was causing rejections of valid GPU commands
from userspace.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/evergreen_cs.c | 5 ++++-
 drivers/gpu/drm/radeon/r600_cs.c      | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

Alex Deucher Jan. 8, 2014, 5:24 p.m. UTC | #1
On Wed, Jan 8, 2014 at 12:16 PM, Marek Olšák <maraeo@gmail.com> wrote:
> From: Marek Olšák <marek.olsak@amd.com>
>
> This fixes a bug which was causing rejections of valid GPU commands
> from userspace.
>
> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
> Cc: stable@vger.kernel.org

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/evergreen_cs.c | 5 ++++-
>  drivers/gpu/drm/radeon/r600_cs.c      | 5 ++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c
> index eb8ac31..c7cac07 100644
> --- a/drivers/gpu/drm/radeon/evergreen_cs.c
> +++ b/drivers/gpu/drm/radeon/evergreen_cs.c
> @@ -967,7 +967,10 @@ static int evergreen_cs_track_check(struct radeon_cs_parser *p)
>         if (track->cb_dirty) {
>                 tmp = track->cb_target_mask;
>                 for (i = 0; i < 8; i++) {
> -                       if ((tmp >> (i * 4)) & 0xF) {
> +                       u32 format = G_028C70_FORMAT(track->cb_color_info[i]);
> +
> +                       if (format != V_028C70_COLOR_INVALID &&
> +                           (tmp >> (i * 4)) & 0xF) {
>                                 /* at least one component is enabled */
>                                 if (track->cb_color_bo[i] == NULL) {
>                                         dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n",
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
> index 5dceea6..56130bf 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -749,7 +749,10 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
>                 }
>
>                 for (i = 0; i < 8; i++) {
> -                       if ((tmp >> (i * 4)) & 0xF) {
> +                       u32 format = G_0280A0_FORMAT(track->cb_color_info[i]);
> +
> +                       if (format != V_0280A0_COLOR_INVALID &&
> +                           (tmp >> (i * 4)) & 0xF) {
>                                 /* at least one component is enabled */
>                                 if (track->cb_color_bo[i] == NULL) {
>                                         dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n",
> --
> 1.8.3.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c
index eb8ac31..c7cac07 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -967,7 +967,10 @@  static int evergreen_cs_track_check(struct radeon_cs_parser *p)
 	if (track->cb_dirty) {
 		tmp = track->cb_target_mask;
 		for (i = 0; i < 8; i++) {
-			if ((tmp >> (i * 4)) & 0xF) {
+			u32 format = G_028C70_FORMAT(track->cb_color_info[i]);
+
+			if (format != V_028C70_COLOR_INVALID &&
+			    (tmp >> (i * 4)) & 0xF) {
 				/* at least one component is enabled */
 				if (track->cb_color_bo[i] == NULL) {
 					dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n",
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 5dceea6..56130bf 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -749,7 +749,10 @@  static int r600_cs_track_check(struct radeon_cs_parser *p)
 		}
 
 		for (i = 0; i < 8; i++) {
-			if ((tmp >> (i * 4)) & 0xF) {
+			u32 format = G_0280A0_FORMAT(track->cb_color_info[i]);
+
+			if (format != V_0280A0_COLOR_INVALID &&
+			    (tmp >> (i * 4)) & 0xF) {
 				/* at least one component is enabled */
 				if (track->cb_color_bo[i] == NULL) {
 					dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n",