Lines Matching refs:p
469 int radeon_vce_cs_reloc(struct radeon_cs_parser *p, int lo, int hi, in radeon_vce_cs_reloc() argument
477 relocs_chunk = p->chunk_relocs; in radeon_vce_cs_reloc()
478 offset = radeon_get_ib_value(p, lo); in radeon_vce_cs_reloc()
479 idx = radeon_get_ib_value(p, hi); in radeon_vce_cs_reloc()
487 reloc = &p->relocs[(idx / 4)]; in radeon_vce_cs_reloc()
492 p->ib.ptr[lo] = start & 0xFFFFFFFF; in radeon_vce_cs_reloc()
493 p->ib.ptr[hi] = start >> 32; in radeon_vce_cs_reloc()
518 static int radeon_vce_validate_handle(struct radeon_cs_parser *p, in radeon_vce_validate_handle() argument
527 if (atomic_read(&p->rdev->vce.handles[i]) == handle) { in radeon_vce_validate_handle()
528 if (p->rdev->vce.filp[i] != p->filp) { in radeon_vce_validate_handle()
538 if (!atomic_cmpxchg(&p->rdev->vce.handles[i], 0, handle)) { in radeon_vce_validate_handle()
539 p->rdev->vce.filp[i] = p->filp; in radeon_vce_validate_handle()
540 p->rdev->vce.img_size[i] = 0; in radeon_vce_validate_handle()
556 int radeon_vce_cs_parse(struct radeon_cs_parser *p) in radeon_vce_cs_parse() argument
564 while (p->idx < p->chunk_ib->length_dw) { in radeon_vce_cs_parse()
565 uint32_t len = radeon_get_ib_value(p, p->idx); in radeon_vce_cs_parse()
566 uint32_t cmd = radeon_get_ib_value(p, p->idx + 1); in radeon_vce_cs_parse()
582 handle = radeon_get_ib_value(p, p->idx + 2); in radeon_vce_cs_parse()
583 session_idx = radeon_vce_validate_handle(p, handle, in radeon_vce_cs_parse()
587 size = &p->rdev->vce.img_size[session_idx]; in radeon_vce_cs_parse()
601 *size = radeon_get_ib_value(p, p->idx + 8) * in radeon_vce_cs_parse()
602 radeon_get_ib_value(p, p->idx + 10) * in radeon_vce_cs_parse()
615 r = radeon_vce_cs_reloc(p, p->idx + 10, p->idx + 9, in radeon_vce_cs_parse()
620 r = radeon_vce_cs_reloc(p, p->idx + 12, p->idx + 11, in radeon_vce_cs_parse()
631 r = radeon_vce_cs_reloc(p, p->idx + 3, p->idx + 2, in radeon_vce_cs_parse()
638 tmp = radeon_get_ib_value(p, p->idx + 4); in radeon_vce_cs_parse()
639 r = radeon_vce_cs_reloc(p, p->idx + 3, p->idx + 2, in radeon_vce_cs_parse()
646 r = radeon_vce_cs_reloc(p, p->idx + 3, p->idx + 2, in radeon_vce_cs_parse()
664 p->idx += len / 4; in radeon_vce_cs_parse()
679 atomic_cmpxchg(&p->rdev->vce.handles[i], handle, 0); in radeon_vce_cs_parse()