ac/nir, radv, radeonsi: Switch to using ac_shader_args
[mesa.git] / src / gallium / drivers / r600 / radeon_vce.c
index 533bc183f06191f723527b62ff0c474d3247e49c..4051d73533d441dd00d8223d69c0a3e13dd290c8 100644 (file)
@@ -97,14 +97,14 @@ static void reset_cpb(struct rvce_encoder *enc)
 {
        unsigned i;
 
-       LIST_INITHEAD(&enc->cpb_slots);
+       list_inithead(&enc->cpb_slots);
        for (i = 0; i < enc->cpb_num; ++i) {
                struct rvce_cpb_slot *slot = &enc->cpb_array[i];
                slot->index = i;
                slot->picture_type = PIPE_H264_ENC_PICTURE_TYPE_SKIP;
                slot->frame_num = 0;
                slot->pic_order_cnt = 0;
-               LIST_ADDTAIL(&slot->list, &enc->cpb_slots);
+               list_addtail(&slot->list, &enc->cpb_slots);
        }
 }
 
@@ -131,13 +131,13 @@ static void sort_cpb(struct rvce_encoder *enc)
        }
 
        if (l1) {
-               LIST_DEL(&l1->list);
-               LIST_ADD(&l1->list, &enc->cpb_slots);
+               list_del(&l1->list);
+               list_add(&l1->list, &enc->cpb_slots);
        }
 
        if (l0) {
-               LIST_DEL(&l0->list);
-               LIST_ADD(&l0->list, &enc->cpb_slots);
+               list_del(&l0->list);
+               list_add(&l0->list, &enc->cpb_slots);
        }
 }
 
@@ -341,8 +341,8 @@ static void rvce_end_frame(struct pipe_video_codec *encoder,
        slot->frame_num = enc->pic.frame_num;
        slot->pic_order_cnt = enc->pic.pic_order_cnt;
        if (!enc->pic.not_referenced) {
-               LIST_DEL(&slot->list);
-               LIST_ADD(&slot->list, &enc->cpb_slots);
+               list_del(&slot->list);
+               list_add(&slot->list, &enc->cpb_slots);
        }
 }
 
@@ -353,7 +353,9 @@ static void rvce_get_feedback(struct pipe_video_codec *encoder,
        struct rvid_buffer *fb = feedback;
 
        if (size) {
-               uint32_t *ptr = enc->ws->buffer_map(fb->res->buf, enc->cs, PIPE_TRANSFER_READ_WRITE);
+               uint32_t *ptr = enc->ws->buffer_map(
+                       fb->res->buf, enc->cs,
+                       PIPE_TRANSFER_READ_WRITE | RADEON_TRANSFER_TEMPORARY);
 
                if (ptr[1]) {
                        *size = ptr[4] - ptr[9];
@@ -409,10 +411,7 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
        if (!enc)
                return NULL;
 
-       if (rscreen->info.drm_major == 3)
-               enc->use_vm = true;
-       if ((rscreen->info.drm_major == 2 && rscreen->info.drm_minor >= 42) ||
-            rscreen->info.drm_major == 3)
+       if (rscreen->info.drm_minor >= 42)
                enc->use_vui = true;
 
        enc->base = *templ;
@@ -428,7 +427,7 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
 
        enc->screen = context->screen;
        enc->ws = ws;
-       enc->cs = ws->cs_create(rctx->ctx, RING_VCE, rvce_cs_flush, enc);
+       enc->cs = ws->cs_create(rctx->ctx, RING_VCE, rvce_cs_flush, enc, false);
        if (!enc->cs) {
                RVID_ERR("Can't get command submission context.\n");
                goto error;
@@ -518,7 +517,7 @@ void rvce_add_buffer(struct rvce_encoder *enc, struct pb_buffer *buf,
        int reloc_idx;
 
        reloc_idx = enc->ws->cs_add_buffer(enc->cs, buf, usage | RADEON_USAGE_SYNCHRONIZED,
-                                          domain, RADEON_PRIO_VCE);
+                                          domain, 0);
        if (enc->use_vm) {
                uint64_t addr;
                addr = enc->ws->buffer_get_virtual_address(buf);