Message ID | 20210225120601.669238-1-enric.balletbo@collabora.com |
---|---|
State | New |
Headers | show |
Series | media: hantro: Auto generate the AXI ID to avoid conflicts | expand |
Hi Enric, Thanks a lot for the patch. On Thu, 25 Feb 2021 at 09:08, Enric Balletbo i Serra <enric.balletbo@collabora.com> wrote: > > The AXI ID is an AXI bus configuration for improve bus performance. If > read and write operations use different ID the operations can be > paralleled, whereas when they have the same ID the operations will be > serialized. Right now, the write ID is fixed to 0 but we can set it to > 0xff to get auto generated ID to avoid possible conflicts. > > This change has no functional changes, but seems reasonable to let the > hardware to autogenerate the ID instead of hardcoding in software. > > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> > --- > > drivers/staging/media/hantro/hantro_g1_h264_dec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/hantro/hantro_g1_h264_dec.c b/drivers/staging/media/hantro/hantro_g1_h264_dec.c > index 845bef73d218..090088cd98ea 100644 > --- a/drivers/staging/media/hantro/hantro_g1_h264_dec.c > +++ b/drivers/staging/media/hantro/hantro_g1_h264_dec.c > @@ -30,7 +30,7 @@ static void set_params(struct hantro_ctx *ctx) > u32 reg; > > /* Decoder control register 0. */ > - reg = G1_REG_DEC_CTRL0_DEC_AXI_WR_ID(0x0); > + reg = G1_REG_DEC_CTRL0_DEC_AXI_WR_ID(0xff); Can we define a macro to avoid this magic number, and add some comments explaining what's 0xff for? Given this is AXI configuration, I'd expect it's CODEC-agnostic. Maybe we could move CODEC-agnostic path to avoid duplicating the code? Does this change apply to the rkvdec driver? Thanks, Ezequiel
diff --git a/drivers/staging/media/hantro/hantro_g1_h264_dec.c b/drivers/staging/media/hantro/hantro_g1_h264_dec.c index 845bef73d218..090088cd98ea 100644 --- a/drivers/staging/media/hantro/hantro_g1_h264_dec.c +++ b/drivers/staging/media/hantro/hantro_g1_h264_dec.c @@ -30,7 +30,7 @@ static void set_params(struct hantro_ctx *ctx) u32 reg; /* Decoder control register 0. */ - reg = G1_REG_DEC_CTRL0_DEC_AXI_WR_ID(0x0); + reg = G1_REG_DEC_CTRL0_DEC_AXI_WR_ID(0xff); if (sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD) reg |= G1_REG_DEC_CTRL0_SEQ_MBAFF_E; if (sps->profile_idc > 66) {
The AXI ID is an AXI bus configuration for improve bus performance. If read and write operations use different ID the operations can be paralleled, whereas when they have the same ID the operations will be serialized. Right now, the write ID is fixed to 0 but we can set it to 0xff to get auto generated ID to avoid possible conflicts. This change has no functional changes, but seems reasonable to let the hardware to autogenerate the ID instead of hardcoding in software. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> --- drivers/staging/media/hantro/hantro_g1_h264_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)