Pull drm updates from Dave Airlie: "Highlights: - AMD enables two more GPUs, with resulting header files - i915 has started to move to TTM for discrete GPU and enable DG1 discrete GPU support (not by default yet) - new HyperV drm driver - vmwgfx adds arm64 support - TTM refactoring ongoing - 16bpc display support for AMD hw Otherwise it's just the usual insane amounts of work all over the place in lots of drivers and the core, as mostly summarised below: Core: - mark AGP ioctls as legacy - disable force probing for non-master clients - HDR metadata property helpers - HDMI infoframe signal colorimetry support - remove drm_device.pdev pointer - remove DRM_KMS_FB_HELPER config option - remove drm_pci_alloc/free - drm_err_*/drm_dbg_* helpers - use drm driver names for fbdev - leaked DMA handle fix - 16bpc fixed point format fourcc - add prefetching memcpy for WC - Documentation fixes aperture: - add aperture ownership helpers dp: - aux fixes - downstream 0 port handling - use extended base receiver capability DPCD - Rename DP_PSR_SELECTIVE_UPDATE to better mach eDP spec - mst: use khz as link rate during init - VCPI fixes for StarTech hub ttm: - provide tt_shrink file via debugfs - warn about freeing pinned BOs - fix swapping error handling - move page alignment into BO - cleanup ttm_agp_backend - add ttm_sys_manager - don't override vm_ops - ttm_bo_mmap removed - make ttm_resource base of all managers - remove VM_MIXEDMAP usage panel: - sysfs_emit support - simple: runtime PM support - simple: power up panel when reading EDID + caching bridge: - MHDP8546: HDCP support + DT bindings - MHDP8546: Register DP AUX channel with userspace - TI SN65DSI83 + SN65DSI84: add driver - Sil8620: Fix module dependencies - dw-hdmi: make CEC driver loading optional - Ti-sn65dsi86: refclk fixes, subdrivers, runtime pm - It66121: Add driver + DT bindings - Adv7511: Support I2S IEC958 encoding - Anx7625: fix power-on delay - Nwi-dsi: Modesetting fixes; Cleanups - lt6911: add missing MODULE_DEVICE_TABLE - cdns: fix PM reference leak hyperv: - add new DRM driver for HyperV graphics efifb: - non-PCI device handling fixes i915: - refactor IP/device versioning - XeLPD Display IP preperation work - ADL-P enablement patches - DG1 uAPI behind BROKEN - disable mmap ioctl for discerte GPUs - start enabling HuC loading for Gen12+ - major GuC backend rework for new platforms - initial TTM support for Discrete GPUs - locking rework for TTM prep - use correct max source link rate for eDP - %p4cc format printing - GLK display fixes - VLV DSI panel power fixes - PSR2 disabled for RKL and ADL-S - ACPI _DSM invalid access fixed - DMC FW path abstraction - ADL-S PCI ID update - uAPI headers converted to kerneldoc - initial LMEM support for DG1 - x86/gpu: add Jasperlake to gen11 early quirks amdgpu: - Aldebaran updates + initial SR-IOV - new GPU: Beige Goby and Yellow Carp support - more LTTPR display work - Vangogh updates - SDMA 5.x GCR fixes - PCIe ASPM support - Renoir TMZ enablement - initial multiple eDP panel support - use fdinfo to track devices/process info - pin/unpin TTM fixes - free resource on fence usage query - fix fence calculation - fix hotunplug/suspend issues - GC/MM register access macro cleanup for SR-IOV - W=1 fixes - ACPI ATCS/ATIF handling rework - 16bpc fixed point format support - Initial smartshift support - RV/PCO power tuning fixes - new INFO query for additional vbios info amdkfd: - SR-IOV aldebaran support - HMM SVM support radeon: - SMU regression fixes - Oland flickering fix vmwgfx: - enable console with fbdev emulation - fix cpu updates of coherent multisample surfaces - remove reservation semaphore - add initial SVGA3 support - support arm64 msm: - devcoredump support for display errors - dpu/dsi: yaml bindings conversion - mdp5: alpha/blend_mode/zpos support - a6xx: cached coherent buffer support - gpu iova fault improvement - a660 support rockchip: - RK3036 win1 scaling support - RK3066/3188 missing register support - RK3036/3066/3126/3188 alpha support mediatek: - MT8167 HDMI support - MT8183 DPI dual edge support tegra: - fixed YUV support/scaling on Tegra186+ ast: - use pcim_iomap - fix DP501 EDID bochs: - screen blanking support etnaviv: - export more GPU ID values to userspace - add HWDB entry for GPU on i.MX8MP - rework linear window calcs exynos: - pm runtime changes imx: - Annotate dma_fence critical section - fix PRG modifiers after drmm conversion - Add 8 pixel alignment fix for 1366x768 - fix YUV advertising - add color properties ingenic: - IPU planes fix panfrost: - Mediatek MT8183 support + DT bindings - export AFBC_FEATURES register to userspace simpledrm: - %pr for printing resources nouveau: - pin/unpin TTM fixes qxl: - unpin shadow BO virtio: - create dumb BOs as guest blob vkms: - drmm_universal_plane_alloc - add XRGB plane composition - overlay support" * tag 'drm-next-2021-07-01' of git://anongit.freedesktop.org/drm/drm: (1570 commits) drm/i915: Reinstate the mmap ioctl for some platforms drm/i915/dsc: abstract helpers to get bigjoiner primary/secondary crtc Revert "drm/msm/mdp5: provide dynamic bandwidth management" drm/msm/mdp5: provide dynamic bandwidth management drm/msm/mdp5: add perf blocks for holding fudge factors drm/msm/mdp5: switch to standard zpos property drm/msm/mdp5: add support for alpha/blend_mode properties drm/msm/mdp5: use drm_plane_state for pixel blend mode drm/msm/mdp5: use drm_plane_state for storing alpha value drm/msm/mdp5: use drm atomic helpers to handle base drm plane state drm/msm/dsi: do not enable PHYs when called for the slave DSI interface drm/msm: Add debugfs to trigger shrinker drm/msm/dpu: Avoid ABBA deadlock between IRQ modules drm/msm: devcoredump iommu fault support iommu/arm-smmu-qcom: Add stall support drm/msm: Improve the a6xx page fault handler iommu/arm-smmu-qcom: Add an adreno-smmu-priv callback to get pagefault info iommu/arm-smmu: Add support for driver IOMMU fault handlers drm/msm: export hangcheck_period in debugfs drm/msm/a6xx: add support for Adreno 660 GPU ...
Showing the changes to include/uapi/linux (1 of 1291 files). Show all
Unified · Split
| @@ -30,9 +30,10 @@ · 29 unmodified lines | |||
| 30 | * - 1.1 - initial version | 30 | * - 1.1 - initial version |
| 31 | * - 1.3 - Add SMI events support | 31 | * - 1.3 - Add SMI events support |
| 32 | * - 1.4 - Indicate new SRAM EDC bit in device properties | 32 | * - 1.4 - Indicate new SRAM EDC bit in device properties |
| 33 | * - 1.5 - Add SVM API | ||
| 33 | */ | 34 | */ |
| 34 | #define KFD_IOCTL_MAJOR_VERSION 1 | 35 | #define KFD_IOCTL_MAJOR_VERSION 1 |
| 35 | #define KFD_IOCTL_MINOR_VERSION 4 | 36 | #define KFD_IOCTL_MINOR_VERSION 5 |
| 36 | 37 | ||
| 37 | struct kfd_ioctl_get_version_args { | 38 | struct kfd_ioctl_get_version_args { |
| 38 | __u32 major_version; /* from KFD */ | 39 | __u32 major_version; /* from KFD */ |
| @@ -473,6 +474,167 @@ enum kfd_mmio_remap { · 434 unmodified lines | |||
| 473 | KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL = 4, | 474 | KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL = 4, |
| 474 | }; | 475 | }; |
| 475 | 476 | ||
| 477 | /* Guarantee host access to memory */ | ||
| 478 | #define KFD_IOCTL_SVM_FLAG_HOST_ACCESS 0x00000001 | ||
| 479 | /* Fine grained coherency between all devices with access */ | ||
| 480 | #define KFD_IOCTL_SVM_FLAG_COHERENT 0x00000002 | ||
| 481 | /* Use any GPU in same hive as preferred device */ | ||
| 482 | #define KFD_IOCTL_SVM_FLAG_HIVE_LOCAL 0x00000004 | ||
| 483 | /* GPUs only read, allows replication */ | ||
| 484 | #define KFD_IOCTL_SVM_FLAG_GPU_RO 0x00000008 | ||
| 485 | /* Allow execution on GPU */ | ||
| 486 | #define KFD_IOCTL_SVM_FLAG_GPU_EXEC 0x00000010 | ||
| 487 | /* GPUs mostly read, may allow similar optimizations as RO, but writes fault */ | ||
| 488 | #define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020 | ||
| 489 | |||
| 490 | /** | ||
| 491 | * kfd_ioctl_svm_op - SVM ioctl operations | ||
| 492 | * | ||
| 493 | * @KFD_IOCTL_SVM_OP_SET_ATTR: Modify one or more attributes | ||
| 494 | * @KFD_IOCTL_SVM_OP_GET_ATTR: Query one or more attributes | ||
| 495 | */ | ||
| 496 | enum kfd_ioctl_svm_op { | ||
| 497 | KFD_IOCTL_SVM_OP_SET_ATTR, | ||
| 498 | KFD_IOCTL_SVM_OP_GET_ATTR | ||
| 499 | }; | ||
| 500 | |||
| 501 | /** kfd_ioctl_svm_location - Enum for preferred and prefetch locations | ||
| 502 | * | ||
| 503 | * GPU IDs are used to specify GPUs as preferred and prefetch locations. | ||
| 504 | * Below definitions are used for system memory or for leaving the preferred | ||
| 505 | * location unspecified. | ||
| 506 | */ | ||
| 507 | enum kfd_ioctl_svm_location { | ||
| 508 | KFD_IOCTL_SVM_LOCATION_SYSMEM = 0, | ||
| 509 | KFD_IOCTL_SVM_LOCATION_UNDEFINED = 0xffffffff | ||
| 510 | }; | ||
| 511 | |||
| 512 | /** | ||
| 513 | * kfd_ioctl_svm_attr_type - SVM attribute types | ||
| 514 | * | ||
| 515 | * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC: gpuid of the preferred location, 0 for | ||
| 516 | * system memory | ||
| 517 | * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC: gpuid of the prefetch location, 0 for | ||
| 518 | * system memory. Setting this triggers an | ||
| 519 | * immediate prefetch (migration). | ||
| 520 | * @KFD_IOCTL_SVM_ATTR_ACCESS: | ||
| 521 | * @KFD_IOCTL_SVM_ATTR_ACCESS_IN_PLACE: | ||
| 522 | * @KFD_IOCTL_SVM_ATTR_NO_ACCESS: specify memory access for the gpuid given | ||
| 523 | * by the attribute value | ||
| 524 | * @KFD_IOCTL_SVM_ATTR_SET_FLAGS: bitmask of flags to set (see | ||
| 525 | * KFD_IOCTL_SVM_FLAG_...) | ||
| 526 | * @KFD_IOCTL_SVM_ATTR_CLR_FLAGS: bitmask of flags to clear | ||
| 527 | * @KFD_IOCTL_SVM_ATTR_GRANULARITY: migration granularity | ||
| 528 | * (log2 num pages) | ||
| 529 | */ | ||
| 530 | enum kfd_ioctl_svm_attr_type { | ||
| 531 | KFD_IOCTL_SVM_ATTR_PREFERRED_LOC, | ||
| 532 | KFD_IOCTL_SVM_ATTR_PREFETCH_LOC, | ||
| 533 | KFD_IOCTL_SVM_ATTR_ACCESS, | ||
| 534 | KFD_IOCTL_SVM_ATTR_ACCESS_IN_PLACE, | ||
| 535 | KFD_IOCTL_SVM_ATTR_NO_ACCESS, | ||
| 536 | KFD_IOCTL_SVM_ATTR_SET_FLAGS, | ||
| 537 | KFD_IOCTL_SVM_ATTR_CLR_FLAGS, | ||
| 538 | KFD_IOCTL_SVM_ATTR_GRANULARITY | ||
| 539 | }; | ||
| 540 | |||
| 541 | /** | ||
| 542 | * kfd_ioctl_svm_attribute - Attributes as pairs of type and value | ||
| 543 | * | ||
| 544 | * The meaning of the @value depends on the attribute type. | ||
| 545 | * | ||
| 546 | * @type: attribute type (see enum @kfd_ioctl_svm_attr_type) | ||
| 547 | * @value: attribute value | ||
| 548 | */ | ||
| 549 | struct kfd_ioctl_svm_attribute { | ||
| 550 | __u32 type; | ||
| 551 | __u32 value; | ||
| 552 | }; | ||
| 553 | |||
| 554 | /** | ||
| 555 | * kfd_ioctl_svm_args - Arguments for SVM ioctl | ||
| 556 | * | ||
| 557 | * @op specifies the operation to perform (see enum | ||
| 558 | * @kfd_ioctl_svm_op). @start_addr and @size are common for all | ||
| 559 | * operations. | ||
| 560 | * | ||
| 561 | * A variable number of attributes can be given in @attrs. | ||
| 562 | * @nattr specifies the number of attributes. New attributes can be | ||
| 563 | * added in the future without breaking the ABI. If unknown attributes | ||
| 564 | * are given, the function returns -EINVAL. | ||
| 565 | * | ||
| 566 | * @KFD_IOCTL_SVM_OP_SET_ATTR sets attributes for a virtual address | ||
| 567 | * range. It may overlap existing virtual address ranges. If it does, | ||
| 568 | * the existing ranges will be split such that the attribute changes | ||
| 569 | * only apply to the specified address range. | ||
| 570 | * | ||
| 571 | * @KFD_IOCTL_SVM_OP_GET_ATTR returns the intersection of attributes | ||
| 572 | * over all memory in the given range and returns the result as the | ||
| 573 | * attribute value. If different pages have different preferred or | ||
| 574 | * prefetch locations, 0xffffffff will be returned for | ||
| 575 | * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC or | ||
| 576 | * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For | ||
| 577 | * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be | ||
| 578 | * aggregated by bitwise AND. The minimum migration granularity | ||
| 579 | * throughout the range will be returned for | ||
| 580 | * @KFD_IOCTL_SVM_ATTR_GRANULARITY. | ||
| 581 | * | ||
| 582 | * Querying of accessibility attributes works by initializing the | ||
| 583 | * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the | ||
| 584 | * GPUID being queried. Multiple attributes can be given to allow | ||
| 585 | * querying multiple GPUIDs. The ioctl function overwrites the | ||
| 586 | * attribute type to indicate the access for the specified GPU. | ||
| 587 | * | ||
| 588 | * @KFD_IOCTL_SVM_ATTR_CLR_FLAGS is invalid for | ||
| 589 | * @KFD_IOCTL_SVM_OP_GET_ATTR. | ||
| 590 | */ | ||
| 591 | struct kfd_ioctl_svm_args { | ||
| 592 | __u64 start_addr; | ||
| 593 | __u64 size; | ||
| 594 | __u32 op; | ||
| 595 | __u32 nattr; | ||
| 596 | /* Variable length array of attributes */ | ||
| 597 | struct kfd_ioctl_svm_attribute attrs[0]; | ||
| 598 | }; | ||
| 599 | |||
| 600 | /** | ||
| 601 | * kfd_ioctl_set_xnack_mode_args - Arguments for set_xnack_mode | ||
| 602 | * | ||
| 603 | * @xnack_enabled: [in/out] Whether to enable XNACK mode for this process | ||
| 604 | * | ||
| 605 | * @xnack_enabled indicates whether recoverable page faults should be | ||
| 606 | * enabled for the current process. 0 means disabled, positive means | ||
| 607 | * enabled, negative means leave unchanged. If enabled, virtual address | ||
| 608 | * translations on GFXv9 and later AMD GPUs can return XNACK and retry | ||
| 609 | * the access until a valid PTE is available. This is used to implement | ||
| 610 | * device page faults. | ||
| 611 | * | ||
| 612 | * On output, @xnack_enabled returns the (new) current mode (0 or | ||
| 613 | * positive). Therefore, a negative input value can be used to query | ||
| 614 | * the current mode without changing it. | ||
| 615 | * | ||
| 616 | * The XNACK mode fundamentally changes the way SVM managed memory works | ||
| 617 | * in the driver, with subtle effects on application performance and | ||
| 618 | * functionality. | ||
| 619 | * | ||
| 620 | * Enabling XNACK mode requires shader programs to be compiled | ||
| 621 | * differently. Furthermore, not all GPUs support changing the mode | ||
| 622 | * per-process. Therefore changing the mode is only allowed while no | ||
| 623 | * user mode queues exist in the process. This ensure that no shader | ||
| 624 | * code is running that may be compiled for the wrong mode. And GPUs | ||
| 625 | * that cannot change to the requested mode will prevent the XNACK | ||
| 626 | * mode from occurring. All GPUs used by the process must be in the | ||
| 627 | * same XNACK mode. | ||
| 628 | * | ||
| 629 | * GFXv8 or older GPUs do not support 48 bit virtual addresses or SVM. | ||
| 630 | * Therefore those GPUs are not considered for the XNACK mode switch. | ||
| 631 | * | ||
| 632 | * Return: 0 on success, -errno on failure | ||
| 633 | */ | ||
| 634 | struct kfd_ioctl_set_xnack_mode_args { | ||
| 635 | __s32 xnack_enabled; | ||
| 636 | }; | ||
| 637 | |||
| 476 | #define AMDKFD_IOCTL_BASE 'K' | 638 | #define AMDKFD_IOCTL_BASE 'K' |
| 477 | #define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr) | 639 | #define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr) |
| 478 | #define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type) | 640 | #define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type) |
| @@ -573,7 +735,12 @@ enum kfd_mmio_remap { · 94 unmodified lines | |||
| 573 | #define AMDKFD_IOC_SMI_EVENTS \ | 735 | #define AMDKFD_IOC_SMI_EVENTS \ |
| 574 | AMDKFD_IOWR(0x1F, struct kfd_ioctl_smi_events_args) | 736 | AMDKFD_IOWR(0x1F, struct kfd_ioctl_smi_events_args) |
| 575 | 737 | ||
| 738 | #define AMDKFD_IOC_SVM AMDKFD_IOWR(0x20, struct kfd_ioctl_svm_args) | ||
| 739 | |||
| 740 | #define AMDKFD_IOC_SET_XNACK_MODE \ | ||
| 741 | AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args) | ||
| 742 | |||
| 576 | #define AMDKFD_COMMAND_START 0x01 | 743 | #define AMDKFD_COMMAND_START 0x01 |
| 577 | #define AMDKFD_COMMAND_END 0x20 | 744 | #define AMDKFD_COMMAND_END 0x22 |
| 578 | 745 | ||
| 579 | #endif | 746 | #endif |