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 <alexdeuc...@gmail.com> wrote:
> From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
> From: Alex Deucher <alexdeuc...@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 <alexdeuc...@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
>
From abf2bcf1318e0170bf1f891ab7e5a7acf64091d8 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeuc...@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 <alexdeuc...@gmail.com>
Cc: stable <sta...@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
------------------------------------------------------------------------------
Download Intel® 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
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel