check the filp is not robust, and sometimes different contexts may
have same filp value.
v2: check both filp and ctx_id
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
unsigned next_rptr_offs;
unsigned fence_offs;
struct drm_file *current_filp;
+ unsigned current_ctx;
bool need_ctx_switch;
enum amdgpu_ring_type type;
char name[16];
ib->is_const_ib = true;
if (chunk_ib->flags & AMDGPU_IB_FLAG_GDS)
ib->gds_needed = true;
- if (ib->ring->current_filp != parser->filp) {
+ if ((ib->ring->current_filp != parser->filp) ||
+ (ib->ring->current_ctx != parser->ctx_id)) {
ib->ring->need_ctx_switch = true;
+ ib->ring->current_ctx = parser->ctx_id;
ib->ring->current_filp = parser->filp;
}