Skip to content

Commit 26df39d

Browse files
committed
Merge tag 'amd-drm-next-6.12-2024-09-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.12-2024-09-13: amdgpu: - GPUVM sync fixes - kdoc fixes - Misc spelling mistakes - Add some raven GFXOFF quirks - Use clamp helper - DC fixes - JPEG fixes - Process isolation fix - Queue reset fix - W=1 cleanup - SMU14 fixes - JPEG fixes amdkfd: - Fetch cacheline info from IP discovery - Queue reset fix - RAS fix - Document SVM events - CRIU fixes - Race fix in dma-buf handling drm: - dma-buf fd race fixes Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents bf05aea + 0c8c5bd commit 26df39d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+678
-366
lines changed

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,7 @@ ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
3939
-I$(FULL_AMD_DISPLAY_PATH)/amdgpu_dm \
4040
-I$(FULL_AMD_PATH)/amdkfd
4141

42-
subdir-ccflags-y := -Wextra
43-
subdir-ccflags-y += -Wunused
44-
subdir-ccflags-y += -Wmissing-prototypes
45-
subdir-ccflags-y += -Wmissing-declarations
46-
subdir-ccflags-y += -Wmissing-include-dirs
47-
subdir-ccflags-y += -Wold-style-definition
48-
subdir-ccflags-y += -Wmissing-format-attribute
49-
# Need this to avoid recursive variable evaluation issues
50-
cond-flags := $(call cc-option, -Wunused-but-set-variable) \
51-
$(call cc-option, -Wunused-const-variable) \
52-
$(call cc-option, -Wstringop-truncation) \
53-
$(call cc-option, -Wpacked-not-aligned)
54-
subdir-ccflags-y += $(cond-flags)
55-
subdir-ccflags-y += -Wno-unused-parameter
56-
subdir-ccflags-y += -Wno-type-limits
57-
subdir-ccflags-y += -Wno-sign-compare
58-
subdir-ccflags-y += -Wno-missing-field-initializers
42+
# Locally disable W=1 warnings enabled in drm subsystem Makefile
5943
subdir-ccflags-y += -Wno-override-init
6044
subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror
6145

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ extern int sched_policy;
237237
extern bool debug_evictions;
238238
extern bool no_system_mem_limit;
239239
extern int halt_if_hws_hang;
240+
extern uint amdgpu_svm_default_granularity;
240241
#else
241242
static const int __maybe_unused sched_policy = KFD_SCHED_POLICY_HWS;
242243
static const bool __maybe_unused debug_evictions; /* = false */

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222
#include <linux/module.h>
23-
#include <linux/fdtable.h>
2423
#include <linux/uaccess.h>
2524
#include <linux/firmware.h>
2625
#include "amdgpu.h"

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/pagemap.h>
2626
#include <linux/sched/mm.h>
2727
#include <linux/sched/task.h>
28-
#include <linux/fdtable.h>
2928
#include <drm/ttm/ttm_tt.h>
3029

3130
#include <drm/drm_exec.h>
@@ -818,18 +817,13 @@ static int kfd_mem_export_dmabuf(struct kgd_mem *mem)
818817
if (!mem->dmabuf) {
819818
struct amdgpu_device *bo_adev;
820819
struct dma_buf *dmabuf;
821-
int r, fd;
822820

823821
bo_adev = amdgpu_ttm_adev(mem->bo->tbo.bdev);
824-
r = drm_gem_prime_handle_to_fd(&bo_adev->ddev, bo_adev->kfd.client.file,
822+
dmabuf = drm_gem_prime_handle_to_dmabuf(&bo_adev->ddev, bo_adev->kfd.client.file,
825823
mem->gem_handle,
826824
mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE ?
827-
DRM_RDWR : 0, &fd);
828-
if (r)
829-
return r;
830-
dmabuf = dma_buf_get(fd);
831-
close_fd(fd);
832-
if (WARN_ON_ONCE(IS_ERR(dmabuf)))
825+
DRM_RDWR : 0);
826+
if (IS_ERR(dmabuf))
833827
return PTR_ERR(dmabuf);
834828
mem->dmabuf = dmabuf;
835829
}

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ uint amdgpu_sdma_phase_quantum = 32;
169169
char *amdgpu_disable_cu;
170170
char *amdgpu_virtual_display;
171171
bool enforce_isolation;
172+
173+
/* Specifies the default granularity for SVM, used in buffer
174+
* migration and restoration of backing memory when handling
175+
* recoverable page faults.
176+
*
177+
* The value is given as log(numPages(buffer)); for a 2 MiB
178+
* buffer it computes to be 9
179+
*/
180+
uint amdgpu_svm_default_granularity = 9;
181+
172182
/*
173183
* OverDrive(bit 14) disabled by default
174184
* GFX DCS(bit 19) disabled by default
@@ -320,6 +330,13 @@ module_param_named(pcie_gen2, amdgpu_pcie_gen2, int, 0444);
320330
MODULE_PARM_DESC(msi, "MSI support (1 = enable, 0 = disable, -1 = auto)");
321331
module_param_named(msi, amdgpu_msi, int, 0444);
322332

333+
/**
334+
* DOC: svm_default_granularity (uint)
335+
* Used in buffer migration and handling of recoverable page faults
336+
*/
337+
MODULE_PARM_DESC(svm_default_granularity, "SVM's default granularity in log(2^Pages), default 9 = 2^9 = 2 MiB");
338+
module_param_named(svm_default_granularity, amdgpu_svm_default_granularity, uint, 0644);
339+
323340
/**
324341
* DOC: lockup_timeout (string)
325342
* Set GPU scheduler timeout value in ms.

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,14 +1397,23 @@ static ssize_t amdgpu_gfx_get_available_compute_partition(struct device *dev,
13971397
static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
13981398
{
13991399
struct amdgpu_device *adev = ring->adev;
1400-
long timeout = msecs_to_jiffies(1000);
1401-
struct dma_fence *f = NULL;
1400+
struct drm_gpu_scheduler *sched = &ring->sched;
1401+
struct drm_sched_entity entity;
1402+
struct dma_fence *f;
14021403
struct amdgpu_job *job;
14031404
struct amdgpu_ib *ib;
14041405
int i, r;
14051406

1406-
r = amdgpu_job_alloc_with_ib(adev, NULL, NULL,
1407-
64, AMDGPU_IB_POOL_DIRECT,
1407+
/* Initialize the scheduler entity */
1408+
r = drm_sched_entity_init(&entity, DRM_SCHED_PRIORITY_NORMAL,
1409+
&sched, 1, NULL);
1410+
if (r) {
1411+
dev_err(adev->dev, "Failed setting up GFX kernel entity.\n");
1412+
goto err;
1413+
}
1414+
1415+
r = amdgpu_job_alloc_with_ib(ring->adev, &entity, NULL,
1416+
64, 0,
14081417
&job);
14091418
if (r)
14101419
goto err;
@@ -1416,24 +1425,18 @@ static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
14161425
ib->ptr[i] = ring->funcs->nop;
14171426
ib->length_dw = ring->funcs->align_mask + 1;
14181427

1419-
r = amdgpu_job_submit_direct(job, ring, &f);
1420-
if (r)
1421-
goto err_free;
1428+
f = amdgpu_job_submit(job);
14221429

1423-
r = dma_fence_wait_timeout(f, false, timeout);
1424-
if (r == 0)
1425-
r = -ETIMEDOUT;
1426-
else if (r > 0)
1427-
r = 0;
1430+
r = dma_fence_wait(f, false);
1431+
if (r)
1432+
goto err;
14281433

1429-
amdgpu_ib_free(adev, ib, f);
14301434
dma_fence_put(f);
14311435

1436+
/* Clean up the scheduler entity */
1437+
drm_sched_entity_destroy(&entity);
14321438
return 0;
14331439

1434-
err_free:
1435-
amdgpu_job_free(job);
1436-
amdgpu_ib_free(adev, ib, f);
14371440
err:
14381441
return r;
14391442
}

drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ int amdgpu_mes_reset_hw_queue_mmio(struct amdgpu_device *adev, int queue_type,
832832
struct mes_reset_queue_input queue_input;
833833
int r;
834834

835+
queue_input.queue_type = queue_type;
835836
queue_input.use_mmio = true;
836837
queue_input.me_id = me_id;
837838
queue_input.pipe_id = pipe_id;

drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void amdgpu_pll_get_fb_ref_div(struct amdgpu_device *adev, unsigned int n
9494
ref_div_max = min(128 / post_div, ref_div_max);
9595

9696
/* get matching reference and feedback divider */
97-
*ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), ref_div_max);
97+
*ref_div = clamp(DIV_ROUND_CLOSEST(den, post_div), 1u, ref_div_max);
9898
*fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den);
9999

100100
/* limit fb divider to its maximum */

drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* Authors: Andres Rodriguez <[email protected]>
2323
*/
2424

25-
#include <linux/fdtable.h>
2625
#include <linux/file.h>
2726
#include <linux/pid.h>
2827

0 commit comments

Comments
 (0)