dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/radeon/kms: more atom parser fixes
@ 2010-04-09 18:41 Alex Deucher
  2010-04-09 18:44 ` Alex Deucher
  2010-04-09 19:04 ` Alex Deucher
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Deucher @ 2010-04-09 18:41 UTC (permalink / raw)
  To: Dave Airlie, DRI Development Mailing List

[-- Attachment #1: Type: text/plain, Size: 2021 bytes --]

>From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
Date: Fri, 9 Apr 2010 14:27:18 -0400
Subject: [PATCH] drm/radeon/kms: more atom parser fixes

shr/shl ops need the full dst rather than the pre-masked
version.  Fixes fdo bug 27478 and kernel bug 15738.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/atom.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 58845e0..44c8cbd 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -905,13 +905,17 @@ static void
atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
 static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 {
 	uint8_t attr = U8((*ptr)++), shift;
-	uint32_t saved, dst;
+	uint32_t saved, dst, tmp;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
 	SDEBUG("   dst: ");
 	dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG("   shift: %d\n", shift);
 	dst <<= shift;
+	dst &= atom_arg_mask[dst_align];
+	dst >>= atom_arg_shift[dst_align];
 	SDEBUG("   dst: ");
 	atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
 }
@@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx,
int *ptr, int arg)
 static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
 {
 	uint8_t attr = U8((*ptr)++), shift;
-	uint32_t saved, dst;
+	uint32_t saved, dst, tmp;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
 	SDEBUG("   dst: ");
 	dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG("   shift: %d\n", shift);
 	dst >>= shift;
+	dst &= atom_arg_mask[dst_align];
+	dst >>= atom_arg_shift[dst_align];
 	SDEBUG("   dst: ");
 	atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
 }
-- 
1.5.6.3

[-- Attachment #2: 0001-drm-radeon-kms-more-atom-parser-fixes.patch --]
[-- Type: text/x-diff, Size: 2021 bytes --]

From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
Date: Fri, 9 Apr 2010 14:27:18 -0400
Subject: [PATCH] drm/radeon/kms: more atom parser fixes

shr/shl ops need the full dst rather than the pre-masked
version.  Fixes fdo bug 27478 and kernel bug 15738.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/atom.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 58845e0..44c8cbd 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -905,13 +905,17 @@ static void atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
 static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 {
 	uint8_t attr = U8((*ptr)++), shift;
-	uint32_t saved, dst;
+	uint32_t saved, dst, tmp;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
 	SDEBUG("   dst: ");
 	dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG("   shift: %d\n", shift);
 	dst <<= shift;
+	dst &= atom_arg_mask[dst_align];
+	dst >>= atom_arg_shift[dst_align];
 	SDEBUG("   dst: ");
 	atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
 }
@@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
 {
 	uint8_t attr = U8((*ptr)++), shift;
-	uint32_t saved, dst;
+	uint32_t saved, dst, tmp;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
 	SDEBUG("   dst: ");
 	dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG("   shift: %d\n", shift);
 	dst >>= shift;
+	dst &= atom_arg_mask[dst_align];
+	dst >>= atom_arg_shift[dst_align];
 	SDEBUG("   dst: ");
 	atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
 }
-- 
1.5.6.3


[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/radeon/kms: more atom parser fixes
  2010-04-09 18:41 [PATCH] drm/radeon/kms: more atom parser fixes Alex Deucher
@ 2010-04-09 18:44 ` Alex Deucher
  2010-04-09 19:04 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2010-04-09 18:44 UTC (permalink / raw)
  To: Dave Airlie, DRI Development Mailing List

This should go to stable as well.  Forgot to add the stable cc.

Alex

On Fri, Apr 9, 2010 at 2:41 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
> From: Alex Deucher <alexdeucher@gmail.com>
> Date: Fri, 9 Apr 2010 14:27:18 -0400
> Subject: [PATCH] drm/radeon/kms: more atom parser fixes
>
> shr/shl ops need the full dst rather than the pre-masked
> version.  Fixes fdo bug 27478 and kernel bug 15738.
>
> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> ---
>  drivers/gpu/drm/radeon/atom.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
> index 58845e0..44c8cbd 100644
> --- a/drivers/gpu/drm/radeon/atom.c
> +++ b/drivers/gpu/drm/radeon/atom.c
> @@ -905,13 +905,17 @@ static void
> atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
>  static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
>  {
>        uint8_t attr = U8((*ptr)++), shift;
> -       uint32_t saved, dst;
> +       uint32_t saved, dst, tmp;
>        int dptr = *ptr;
> +       uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
>        SDEBUG("   dst: ");
>        dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
> +       dst = saved;
>        shift = atom_get_src(ctx, attr, ptr);
>        SDEBUG("   shift: %d\n", shift);
>        dst <<= shift;
> +       dst &= atom_arg_mask[dst_align];
> +       dst >>= atom_arg_shift[dst_align];
>        SDEBUG("   dst: ");
>        atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
>  }
> @@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx,
> int *ptr, int arg)
>  static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
>  {
>        uint8_t attr = U8((*ptr)++), shift;
> -       uint32_t saved, dst;
> +       uint32_t saved, dst, tmp;
>        int dptr = *ptr;
> +       uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
>        SDEBUG("   dst: ");
>        dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
> +       dst = saved;
>        shift = atom_get_src(ctx, attr, ptr);
>        SDEBUG("   shift: %d\n", shift);
>        dst >>= shift;
> +       dst &= atom_arg_mask[dst_align];
> +       dst >>= atom_arg_shift[dst_align];
>        SDEBUG("   dst: ");
>        atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
>  }
> --
> 1.5.6.3
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/radeon/kms: more atom parser fixes
  2010-04-09 18:41 [PATCH] drm/radeon/kms: more atom parser fixes Alex Deucher
  2010-04-09 18:44 ` Alex Deucher
@ 2010-04-09 19:04 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2010-04-09 19:04 UTC (permalink / raw)
  To: Dave Airlie, DRI Development Mailing List

[-- Attachment #1: Type: text/plain, Size: 2543 bytes --]

Updated version with stable cc and remove some leftover unused vars
noticed by roysjosh on IRC.

Alex

On Fri, Apr 9, 2010 at 2:41 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
> From: Alex Deucher <alexdeucher@gmail.com>
> Date: Fri, 9 Apr 2010 14:27:18 -0400
> Subject: [PATCH] drm/radeon/kms: more atom parser fixes
>
> shr/shl ops need the full dst rather than the pre-masked
> version.  Fixes fdo bug 27478 and kernel bug 15738.
>
> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> ---
>  drivers/gpu/drm/radeon/atom.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
> index 58845e0..44c8cbd 100644
> --- a/drivers/gpu/drm/radeon/atom.c
> +++ b/drivers/gpu/drm/radeon/atom.c
> @@ -905,13 +905,17 @@ static void
> atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
>  static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
>  {
>        uint8_t attr = U8((*ptr)++), shift;
> -       uint32_t saved, dst;
> +       uint32_t saved, dst, tmp;
>        int dptr = *ptr;
> +       uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
>        SDEBUG("   dst: ");
>        dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
> +       dst = saved;
>        shift = atom_get_src(ctx, attr, ptr);
>        SDEBUG("   shift: %d\n", shift);
>        dst <<= shift;
> +       dst &= atom_arg_mask[dst_align];
> +       dst >>= atom_arg_shift[dst_align];
>        SDEBUG("   dst: ");
>        atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
>  }
> @@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx,
> int *ptr, int arg)
>  static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
>  {
>        uint8_t attr = U8((*ptr)++), shift;
> -       uint32_t saved, dst;
> +       uint32_t saved, dst, tmp;
>        int dptr = *ptr;
> +       uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
>        SDEBUG("   dst: ");
>        dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
> +       dst = saved;
>        shift = atom_get_src(ctx, attr, ptr);
>        SDEBUG("   shift: %d\n", shift);
>        dst >>= shift;
> +       dst &= atom_arg_mask[dst_align];
> +       dst >>= atom_arg_shift[dst_align];
>        SDEBUG("   dst: ");
>        atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
>  }
> --
> 1.5.6.3
>

[-- Attachment #2: 0001-drm-radeon-kms-more-atom-parser-fixes-v2.patch --]
[-- Type: text/x-diff, Size: 1961 bytes --]

From abf2bcf1318e0170bf1f891ab7e5a7acf64091d8 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
Date: Fri, 9 Apr 2010 15:01:25 -0400
Subject: [PATCH] drm/radeon/kms: more atom parser fixes (v2)

shr/shl ops need the full dst rather than the pre-masked
version.  Fixes fdo bug 27478 and kernel bug 15738.

v2: remove some unsed vars, add comments

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable <stable@kernel.org>
---
 drivers/gpu/drm/radeon/atom.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 58845e0..a8bf500 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -907,11 +907,16 @@ static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 	uint8_t attr = U8((*ptr)++), shift;
 	uint32_t saved, dst;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
 	SDEBUG("   dst: ");
 	dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
+	/* op needs to full dst value */
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG("   shift: %d\n", shift);
 	dst <<= shift;
+	dst &= atom_arg_mask[dst_align];
+	dst >>= atom_arg_shift[dst_align];
 	SDEBUG("   dst: ");
 	atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
 }
@@ -921,11 +926,16 @@ static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
 	uint8_t attr = U8((*ptr)++), shift;
 	uint32_t saved, dst;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3];
 	SDEBUG("   dst: ");
 	dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
+	/* op needs to full dst value */
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG("   shift: %d\n", shift);
 	dst >>= shift;
+	dst &= atom_arg_mask[dst_align];
+	dst >>= atom_arg_shift[dst_align];
 	SDEBUG("   dst: ");
 	atom_put_dst(ctx, arg, attr, &dptr, dst, saved);
 }
-- 
1.5.6.3


[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-09 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 18:41 [PATCH] drm/radeon/kms: more atom parser fixes Alex Deucher
2010-04-09 18:44 ` Alex Deucher
2010-04-09 19:04 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).