On Tue, Feb 11, 2025 at 4:02 AM Jesse.zhang@xxxxxxx <jesse.zhang@xxxxxxx> wrote: > > This patch updates the sdma engine to support scheduling for > the page queue. The main changes include: > > - Introduce a new variable `page` to handle the page queue if it exists. > - Update the scheduling logic to conditionally set the `sched.ready` flag for > both the sdma gfx queue and the page queue based on the provided mask. > - Ensure that the scheduling flags are updated correctly for both queues when > the mask is applied. > > The patch ensures that the SDMA engine can handle scheduling for both the sdma gfx > queue and the page queue, > > Signed-off-by: Jesse Zhang <jesse.zhang@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c > index 6ba785798a4a..e82ded95540c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c > @@ -358,7 +358,7 @@ static int amdgpu_debugfs_sdma_sched_mask_set(void *data, u64 val) > struct amdgpu_device *adev = (struct amdgpu_device *)data; > u32 i; > u64 mask = 0; > - struct amdgpu_ring *ring; > + struct amdgpu_ring *ring, *page; > > if (!adev) > return -ENODEV; > @@ -369,10 +369,18 @@ static int amdgpu_debugfs_sdma_sched_mask_set(void *data, u64 val) > > for (i = 0; i < adev->sdma.num_instances; ++i) { > ring = &adev->sdma.instance[i].ring; > - if (val & BIT_ULL(i)) > + if (adev->sdma.has_page_queue) > + page = &adev->sdma.instance[i].page; > + if (val & BIT_ULL(i)) { > ring->sched.ready = true; > - else > + if (adev->sdma.has_page_queue) > + page->sched.ready = true; > + } else { > ring->sched.ready = false; > + if (adev->sdma.has_page_queue) > + page->sched.ready = false; > + } > + Not really specific to this patch, but if we disable schedulers here, we may disable the buffer_funcs scheduler used by the driver for memory management. Alex > } > /* publish sched.ready flag update effective immediately across smp */ > smp_rmb(); > -- > 2.25.1 >