drm/radeon/kms/ni: fix packet2 handling for VM IB parser
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 12 Jan 2012 20:42:37 +0000 (15:42 -0500)
committerDave Airlie <airlied@redhat.com>
Fri, 13 Jan 2012 09:00:16 +0000 (09:00 +0000)
Packet2 is only one dword.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/evergreen_cs.c

index f7442e62c03f676c42afc518eba2be44400c43da..8e8cd85e5c0045926fb6f185744532eb2d588464 100644 (file)
@@ -1793,10 +1793,12 @@ int evergreen_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib)
                        ret = -EINVAL;
                        break;
                case PACKET_TYPE2:
+                       idx += 1;
                        break;
                case PACKET_TYPE3:
                        pkt.opcode = CP_PACKET3_GET_OPCODE(ib->ptr[idx]);
                        ret = evergreen_vm_packet3_check(rdev, ib->ptr, &pkt);
+                       idx += pkt.count + 2;
                        break;
                default:
                        dev_err(rdev->dev, "Unknown packet type %d !\n", pkt.type);
@@ -1805,7 +1807,6 @@ int evergreen_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib)
                }
                if (ret)
                        break;
-               idx += pkt.count + 2;
        } while (idx < ib->length_dw);
 
        return ret;