]> Git Repo - linux.git/commitdiff
drm/amdgpu: Fix failure when switching to DPX mode
authorMukul Joshi <[email protected]>
Thu, 29 Sep 2022 16:07:49 +0000 (12:07 -0400)
committerAlex Deucher <[email protected]>
Fri, 9 Jun 2023 13:46:54 +0000 (09:46 -0400)
Fix the if condition which causes dynamic repartitioning
to fail when trying to switch to DPX mode.

Signed-off-by: Mukul Joshi <[email protected]>
Reviewed-by: Amber Lin <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

index 69bac5b801cee4f59439585e795e84eda1b5966e..2f6d85090b55e2c6983d7c3f33da86abb5af73c0 100644 (file)
@@ -1216,7 +1216,11 @@ static ssize_t amdgpu_gfx_set_compute_partition(struct device *dev,
        if (!strncasecmp("SPX", buf, strlen("SPX"))) {
                mode = AMDGPU_SPX_PARTITION_MODE;
        } else if (!strncasecmp("DPX", buf, strlen("DPX"))) {
-               if (num_xcc != 4 || num_xcc != 8)
+               /*
+                * DPX mode needs AIDs to be in multiple of 2.
+                * Each AID connects 2 XCCs.
+                */
+               if (num_xcc%4)
                        return -EINVAL;
                mode = AMDGPU_DPX_PARTITION_MODE;
        } else if (!strncasecmp("TPX", buf, strlen("TPX"))) {
This page took 0.061069 seconds and 4 git commands to generate.