[Mesa-dev] [PATCH 4/4] radeonsi: use SDMA for uploading data through const_uploader

Alex Deucher alexdeucher at gmail.com
Thu Feb 7 20:00:01 UTC 2019


On Thu, Feb 7, 2019 at 2:47 PM Axel Davy <davyaxel0 at gmail.com> wrote:
>
> On 07/02/2019 02:22, Marek Olšák wrote:
> >
> > +     bool use_sdma_upload = sscreen->info.has_dedicated_vram && sctx->dma_cs && debug_get_bool_option("SDMA", true);
> > +     sctx->b.const_uploader = u_upload_create(&sctx->b, 256 * 1024,
> > +                                              0, PIPE_USAGE_DEFAULT,
> > +                                              SI_RESOURCE_FLAG_32BIT |
> > +                                              (use_sdma_upload ?
> > +                                                       SI_RESOURCE_FLAG_UPLOAD_FLUSH_EXPLICIT_VIA_SDMA :
> > +                                                       (sscreen->cpdma_prefetch_writes_memory ?
> > +                                                                0 : SI_RESOURCE_FLAG_READ_ONLY)));
> > +     if (!sctx->b.const_uploader)
> > +             goto fail;
> > +
> > +     if (use_sdma_upload)
> > +             u_upload_enable_flush_explicit(sctx->b.const_uploader);
> > +
>
>
> I see that APU are not affected by the change.
>
> Are they affected by the issue this patch aims to fix though ? If so,
> wouldn't it make sense to switch to PIPE_USAGE_STREAM for APUs ?

They are not affected.  "VRAM" on APUs is just carved out system
memory so the driver can access it directly.  No need to go through
the PCI BAR interface.  All of "VRAM" is visible to the CPU on APUs.

Alex


More information about the mesa-dev mailing list