diff options
| author | Alex Deucher <alexdeucher@gmail.com> | 2010-04-09 15:01:25 -0400 | 
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2010-04-09 18:52:32 -0400 | 
| commit | 65384a1d41c4e91f0b49d90d11b7f424d6e5c58e (patch) | |
| tree | e90155b8f5a77a1e30346ff24189572372fe5aa0 | |
| parent | 930b9d94579fa1ea9604cbf7ba56cedf99ba9b5c (diff) | |
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>
Signed-off-by: Dave Airlie <airlied@redhat.com>
| -rw-r--r-- | 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 58845e053b36..a8bf50042464 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) | |||
| 907 | uint8_t attr = U8((*ptr)++), shift; | 907 | uint8_t attr = U8((*ptr)++), shift; | 
| 908 | uint32_t saved, dst; | 908 | uint32_t saved, dst; | 
| 909 | int dptr = *ptr; | 909 | int dptr = *ptr; | 
| 910 | uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3]; | ||
| 910 | SDEBUG(" dst: "); | 911 | SDEBUG(" dst: "); | 
| 911 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); | 912 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); | 
| 913 | /* op needs to full dst value */ | ||
| 914 | dst = saved; | ||
| 912 | shift = atom_get_src(ctx, attr, ptr); | 915 | shift = atom_get_src(ctx, attr, ptr); | 
| 913 | SDEBUG(" shift: %d\n", shift); | 916 | SDEBUG(" shift: %d\n", shift); | 
| 914 | dst <<= shift; | 917 | dst <<= shift; | 
| 918 | dst &= atom_arg_mask[dst_align]; | ||
| 919 | dst >>= atom_arg_shift[dst_align]; | ||
| 915 | SDEBUG(" dst: "); | 920 | SDEBUG(" dst: "); | 
| 916 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); | 921 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); | 
| 917 | } | 922 | } | 
| @@ -921,11 +926,16 @@ static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg) | |||
| 921 | uint8_t attr = U8((*ptr)++), shift; | 926 | uint8_t attr = U8((*ptr)++), shift; | 
| 922 | uint32_t saved, dst; | 927 | uint32_t saved, dst; | 
| 923 | int dptr = *ptr; | 928 | int dptr = *ptr; | 
| 929 | uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3]; | ||
| 924 | SDEBUG(" dst: "); | 930 | SDEBUG(" dst: "); | 
| 925 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); | 931 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); | 
| 932 | /* op needs to full dst value */ | ||
| 933 | dst = saved; | ||
| 926 | shift = atom_get_src(ctx, attr, ptr); | 934 | shift = atom_get_src(ctx, attr, ptr); | 
| 927 | SDEBUG(" shift: %d\n", shift); | 935 | SDEBUG(" shift: %d\n", shift); | 
| 928 | dst >>= shift; | 936 | dst >>= shift; | 
| 937 | dst &= atom_arg_mask[dst_align]; | ||
| 938 | dst >>= atom_arg_shift[dst_align]; | ||
| 929 | SDEBUG(" dst: "); | 939 | SDEBUG(" dst: "); | 
| 930 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); | 940 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); | 
| 931 | } | 941 | } | 
