diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-04-09 15:01:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-26 10:47:55 -0400 |
commit | 4a9f5b424287bb6469caee0be5e8305429d7a180 (patch) | |
tree | 7b6906c61cd564742e8e91642e2430b9d26ffc9a | |
parent | 951a0c46c5b9810962ca116396c8881ee5b96b71 (diff) |
drm/radeon/kms: more atom parser fixes (v2)
commit 65384a1d41c4e91f0b49d90d11b7f424d6e5c58e upstream.
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>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 d75788feac6c..b1f929d4e1aa 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
@@ -881,11 +881,16 @@ static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg) | |||
881 | uint8_t attr = U8((*ptr)++), shift; | 881 | uint8_t attr = U8((*ptr)++), shift; |
882 | uint32_t saved, dst; | 882 | uint32_t saved, dst; |
883 | int dptr = *ptr; | 883 | int dptr = *ptr; |
884 | uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3]; | ||
884 | SDEBUG(" dst: "); | 885 | SDEBUG(" dst: "); |
885 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); | 886 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); |
887 | /* op needs to full dst value */ | ||
888 | dst = saved; | ||
886 | shift = atom_get_src(ctx, attr, ptr); | 889 | shift = atom_get_src(ctx, attr, ptr); |
887 | SDEBUG(" shift: %d\n", shift); | 890 | SDEBUG(" shift: %d\n", shift); |
888 | dst <<= shift; | 891 | dst <<= shift; |
892 | dst &= atom_arg_mask[dst_align]; | ||
893 | dst >>= atom_arg_shift[dst_align]; | ||
889 | SDEBUG(" dst: "); | 894 | SDEBUG(" dst: "); |
890 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); | 895 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); |
891 | } | 896 | } |
@@ -895,11 +900,16 @@ static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg) | |||
895 | uint8_t attr = U8((*ptr)++), shift; | 900 | uint8_t attr = U8((*ptr)++), shift; |
896 | uint32_t saved, dst; | 901 | uint32_t saved, dst; |
897 | int dptr = *ptr; | 902 | int dptr = *ptr; |
903 | uint32_t dst_align = atom_dst_to_src[(attr >> 3) & 7][(attr >> 6) & 3]; | ||
898 | SDEBUG(" dst: "); | 904 | SDEBUG(" dst: "); |
899 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); | 905 | dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1); |
906 | /* op needs to full dst value */ | ||
907 | dst = saved; | ||
900 | shift = atom_get_src(ctx, attr, ptr); | 908 | shift = atom_get_src(ctx, attr, ptr); |
901 | SDEBUG(" shift: %d\n", shift); | 909 | SDEBUG(" shift: %d\n", shift); |
902 | dst >>= shift; | 910 | dst >>= shift; |
911 | dst &= atom_arg_mask[dst_align]; | ||
912 | dst >>= atom_arg_shift[dst_align]; | ||
903 | SDEBUG(" dst: "); | 913 | SDEBUG(" dst: "); |
904 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); | 914 | atom_put_dst(ctx, arg, attr, &dptr, dst, saved); |
905 | } | 915 | } |