Re: [V3] venus: vdec: decoded picture buffer handling during reconfig sequence

From: Stanimir Varbanov
Date: Tue Sep 28 2021 - 08:59:19 EST


>>> +static DEFINE_IDA(dpb_out_tag_ida);
>> No global static variables please. Make it part of venus_inst structure.
> As per my understanding it is not just static global variable.
> We are defining the ida structure and assign to name when pass as param
> as follows
> struct ida {
>              struct idr        idr;
>              struct ida_bitmap    *free_bitmap;
> };
> #define IDA_INIT(name)        { .idr = IDR_INIT((name).idr),
> .free_bitmap = NULL, }
> #define DEFINE_IDA(name)    struct ida name = IDA_INIT(name)
> Any ida related API's expect pointer to this structure.
> If we move the variable then it might be bit difficult use ida_xxx()
> API'same
Add a struct ida dpb_ids in venus_inst or venus_core structures
depending on what you need (ID allocations per session or for all
sessions) and use ida_init(&dpb_ids).