summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/xe
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/xe')
-rw-r--r--drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h6
-rw-r--r--drivers/gpu/drm/xe/compat-i915-headers/intel_step.h10
-rw-r--r--drivers/gpu/drm/xe/display/intel_fb_bo.c9
-rw-r--r--drivers/gpu/drm/xe/xe_bo.c7
-rw-r--r--drivers/gpu/drm/xe/xe_debugfs.c3
-rw-r--r--drivers/gpu/drm/xe/xe_device_types.h6
-rw-r--r--drivers/gpu/drm/xe/xe_pci.c3
-rw-r--r--drivers/gpu/drm/xe/xe_step.c57
-rw-r--r--drivers/gpu/drm/xe/xe_step_types.h30
-rw-r--r--drivers/gpu/drm/xe/xe_vm.c11
10 files changed, 83 insertions, 59 deletions
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
index 2feedddf1e40..b7b12b20e390 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
@@ -80,11 +80,6 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev)
#define IS_MOBILE(xe) (xe && 0)
-#define HAS_GMD_ID(xe) GRAPHICS_VERx100(xe) >= 1270
-
-/* Workarounds not handled yet */
-#define IS_DISPLAY_STEP(xe, first, last) ({u8 __step = (xe)->info.step.display; first <= __step && __step <= last; })
-
#define IS_LP(xe) (0)
#define IS_GEN9_LP(xe) (0)
#define IS_GEN9_BC(xe) (0)
@@ -116,7 +111,6 @@ struct i915_sched_attr {
#define i915_gem_fence_wait_priority(fence, attr) do { (void) attr; } while (0)
#define pdev_to_i915 pdev_to_xe_device
-#define RUNTIME_INFO(xe) (&(xe)->info.i915_runtime)
#define FORCEWAKE_ALL XE_FORCEWAKE_ALL
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h b/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h
index 0006ef812346..2cf13a572ab0 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/intel_step.h
@@ -6,15 +6,9 @@
#ifndef __INTEL_STEP_H__
#define __INTEL_STEP_H__
-#include "xe_device_types.h"
#include "xe_step.h"
-#define intel_display_step_name xe_display_step_name
-
-static inline
-const char *xe_display_step_name(struct xe_device *xe)
-{
- return xe_step_name(xe->info.step.display);
-}
+#define intel_step xe_step
+#define intel_step_name xe_step_name
#endif /* __INTEL_STEP_H__ */
diff --git a/drivers/gpu/drm/xe/display/intel_fb_bo.c b/drivers/gpu/drm/xe/display/intel_fb_bo.c
index f835492f73fb..63ce97cc4cfe 100644
--- a/drivers/gpu/drm/xe/display/intel_fb_bo.c
+++ b/drivers/gpu/drm/xe/display/intel_fb_bo.c
@@ -7,6 +7,7 @@
#include <drm/ttm/ttm_bo.h>
#include "intel_display_types.h"
+#include "intel_fb.h"
#include "intel_fb_bo.h"
#include "xe_bo.h"
@@ -28,6 +29,14 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
struct xe_device *xe = to_xe_device(bo->ttm.base.dev);
int ret;
+ /*
+ * Some modifiers require physical alignment of 64KiB VRAM pages;
+ * require that the BO in those cases is created correctly.
+ */
+ if (XE_IOCTL_DBG(xe, intel_fb_needs_64k_phys(mode_cmd->modifier[0]) &&
+ !(bo->flags & XE_BO_FLAG_NEEDS_64K)))
+ return -EINVAL;
+
xe_bo_get(bo);
ret = ttm_bo_reserve(&bo->ttm, true, false, NULL);
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index e3d68710a91a..25d0c939ba31 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1997,6 +1997,13 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
bo_flags |= args->placement << (ffs(XE_BO_FLAG_SYSTEM) - 1);
+ /* CCS formats need physical placement at a 64K alignment in VRAM. */
+ if ((bo_flags & XE_BO_FLAG_VRAM_MASK) &&
+ (bo_flags & XE_BO_FLAG_SCANOUT) &&
+ !(xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K) &&
+ IS_ALIGNED(args->size, SZ_64K))
+ bo_flags |= XE_BO_FLAG_NEEDS_64K;
+
if (args->flags & DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM) {
if (XE_IOCTL_DBG(xe, !(bo_flags & XE_BO_FLAG_VRAM_MASK)))
return -EINVAL;
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index 1011e5d281fa..a64bae36e0e3 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -47,10 +47,9 @@ static int info(struct seq_file *m, void *data)
drm_printf(&p, "graphics_verx100 %d\n", xe->info.graphics_verx100);
drm_printf(&p, "media_verx100 %d\n", xe->info.media_verx100);
- drm_printf(&p, "stepping G:%s M:%s D:%s B:%s\n",
+ drm_printf(&p, "stepping G:%s M:%s B:%s\n",
xe_step_name(xe->info.step.graphics),
xe_step_name(xe->info.step.media),
- xe_step_name(xe->info.step.display),
xe_step_name(xe->info.step.basedie));
drm_printf(&p, "is_dgfx %s\n", str_yes_no(xe->info.is_dgfx));
drm_printf(&p, "platform %d\n", xe->info.platform);
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 856db4020048..e73fb0c23932 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -305,12 +305,6 @@ struct xe_device {
u8 has_atomic_enable_pte_bit:1;
/** @info.has_device_atomics_on_smem: Supports device atomics on SMEM */
u8 has_device_atomics_on_smem:1;
-
-#if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
- struct {
- u32 rawclk_freq;
- } i915_runtime;
-#endif
} info;
/** @irq: device interrupt state */
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 7eb00a87b786..f276194d9c4e 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -831,10 +831,9 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
xe->info.dma_mask_size, xe->info.tile_count,
xe->info.has_heci_gscfi, xe->info.has_heci_cscfi);
- drm_dbg(&xe->drm, "Stepping = (G:%s, M:%s, D:%s, B:%s)\n",
+ drm_dbg(&xe->drm, "Stepping = (G:%s, M:%s, B:%s)\n",
xe_step_name(xe->info.step.graphics),
xe_step_name(xe->info.step.media),
- xe_step_name(xe->info.step.display),
xe_step_name(xe->info.step.basedie));
drm_dbg(&xe->drm, "SR-IOV support: %s (mode: %s)\n",
diff --git a/drivers/gpu/drm/xe/xe_step.c b/drivers/gpu/drm/xe/xe_step.c
index eaf1b718f26c..c77b5c317fa0 100644
--- a/drivers/gpu/drm/xe/xe_step.c
+++ b/drivers/gpu/drm/xe/xe_step.c
@@ -28,23 +28,17 @@
* use a macro to define these to make it easier to identify the platforms
* where the two steppings can deviate.
*/
-#define COMMON_GT_MEDIA_STEP(x_) \
- .graphics = STEP_##x_, \
- .media = STEP_##x_
-
#define COMMON_STEP(x_) \
- COMMON_GT_MEDIA_STEP(x_), \
.graphics = STEP_##x_, \
- .media = STEP_##x_, \
- .display = STEP_##x_
+ .media = STEP_##x_
__diag_push();
__diag_ignore_all("-Woverride-init", "Allow field overrides in table");
/* Same GT stepping between tgl_uy_revids and tgl_revids don't mean the same HW */
static const struct xe_step_info tgl_revids[] = {
- [0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_B0 },
- [1] = { COMMON_GT_MEDIA_STEP(B0), .display = STEP_D0 },
+ [0] = { COMMON_STEP(A0) },
+ [1] = { COMMON_STEP(B0) },
};
static const struct xe_step_info dg1_revids[] = {
@@ -53,49 +47,49 @@ static const struct xe_step_info dg1_revids[] = {
};
static const struct xe_step_info adls_revids[] = {
- [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_A0 },
- [0x1] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_A2 },
- [0x4] = { COMMON_GT_MEDIA_STEP(B0), .display = STEP_B0 },
- [0x8] = { COMMON_GT_MEDIA_STEP(C0), .display = STEP_B0 },
- [0xC] = { COMMON_GT_MEDIA_STEP(D0), .display = STEP_C0 },
+ [0x0] = { COMMON_STEP(A0) },
+ [0x1] = { COMMON_STEP(A0) },
+ [0x4] = { COMMON_STEP(B0) },
+ [0x8] = { COMMON_STEP(C0) },
+ [0xC] = { COMMON_STEP(D0) },
};
static const struct xe_step_info adls_rpls_revids[] = {
- [0x4] = { COMMON_GT_MEDIA_STEP(D0), .display = STEP_D0 },
- [0xC] = { COMMON_GT_MEDIA_STEP(D0), .display = STEP_C0 },
+ [0x4] = { COMMON_STEP(D0) },
+ [0xC] = { COMMON_STEP(D0) },
};
static const struct xe_step_info adlp_revids[] = {
- [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_A0 },
- [0x4] = { COMMON_GT_MEDIA_STEP(B0), .display = STEP_B0 },
- [0x8] = { COMMON_GT_MEDIA_STEP(C0), .display = STEP_C0 },
- [0xC] = { COMMON_GT_MEDIA_STEP(C0), .display = STEP_D0 },
+ [0x0] = { COMMON_STEP(A0) },
+ [0x4] = { COMMON_STEP(B0) },
+ [0x8] = { COMMON_STEP(C0) },
+ [0xC] = { COMMON_STEP(C0) },
};
static const struct xe_step_info adlp_rpl_revids[] = {
- [0x4] = { COMMON_GT_MEDIA_STEP(C0), .display = STEP_E0 },
+ [0x4] = { COMMON_STEP(C0) },
};
static const struct xe_step_info adln_revids[] = {
- [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_D0 },
+ [0x0] = { COMMON_STEP(A0) },
};
static const struct xe_step_info dg2_g10_revid_step_tbl[] = {
- [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_A0 },
- [0x1] = { COMMON_GT_MEDIA_STEP(A1), .display = STEP_A0 },
- [0x4] = { COMMON_GT_MEDIA_STEP(B0), .display = STEP_B0 },
- [0x8] = { COMMON_GT_MEDIA_STEP(C0), .display = STEP_C0 },
+ [0x0] = { COMMON_STEP(A0) },
+ [0x1] = { COMMON_STEP(A1) },
+ [0x4] = { COMMON_STEP(B0) },
+ [0x8] = { COMMON_STEP(C0) },
};
static const struct xe_step_info dg2_g11_revid_step_tbl[] = {
- [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_B0 },
- [0x4] = { COMMON_GT_MEDIA_STEP(B0), .display = STEP_C0 },
- [0x5] = { COMMON_GT_MEDIA_STEP(B1), .display = STEP_C0 },
+ [0x0] = { COMMON_STEP(A0) },
+ [0x4] = { COMMON_STEP(B0) },
+ [0x5] = { COMMON_STEP(B1) },
};
static const struct xe_step_info dg2_g12_revid_step_tbl[] = {
- [0x0] = { COMMON_GT_MEDIA_STEP(A0), .display = STEP_C0 },
- [0x1] = { COMMON_GT_MEDIA_STEP(A1), .display = STEP_C0 },
+ [0x0] = { COMMON_STEP(A0) },
+ [0x1] = { COMMON_STEP(A1) },
};
static const struct xe_step_info pvc_revid_step_tbl[] = {
@@ -195,7 +189,6 @@ struct xe_step_info xe_step_pre_gmdid_get(struct xe_device *xe)
} else {
drm_dbg(&xe->drm, "Using future steppings\n");
step.graphics = STEP_FUTURE;
- step.display = STEP_FUTURE;
}
}
diff --git a/drivers/gpu/drm/xe/xe_step_types.h b/drivers/gpu/drm/xe/xe_step_types.h
index ccc9b4795e95..d978cc2512f2 100644
--- a/drivers/gpu/drm/xe/xe_step_types.h
+++ b/drivers/gpu/drm/xe/xe_step_types.h
@@ -11,12 +11,15 @@
struct xe_step_info {
u8 graphics;
u8 media;
- u8 display;
u8 basedie;
};
#define STEP_ENUM_VAL(name) STEP_##name,
+/*
+ * Always define four minor steppings 0-3 for each stepping to match GMD ID
+ * spacing of values. See xe_step_gmdid_get().
+ */
#define STEP_NAME_LIST(func) \
func(A0) \
func(A1) \
@@ -34,7 +37,30 @@ struct xe_step_info {
func(D1) \
func(D2) \
func(D3) \
- func(E0)
+ func(E0) \
+ func(E1) \
+ func(E2) \
+ func(E3) \
+ func(F0) \
+ func(F1) \
+ func(F2) \
+ func(F3) \
+ func(G0) \
+ func(G1) \
+ func(G2) \
+ func(G3) \
+ func(H0) \
+ func(H1) \
+ func(H2) \
+ func(H3) \
+ func(I0) \
+ func(I1) \
+ func(I2) \
+ func(I3) \
+ func(J0) \
+ func(J1) \
+ func(J2) \
+ func(J3)
/*
* Symbolic steppings that do not match the hardware. These are valid both as gt
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 4cc13eddb6b3..3eb76d874eb2 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -2878,7 +2878,16 @@ static int xe_vm_bind_ioctl_validate_bo(struct xe_device *xe, struct xe_bo *bo,
return -EINVAL;
}
- if (bo->flags & XE_BO_FLAG_INTERNAL_64K) {
+ /*
+ * Some platforms require 64k VM_BIND alignment,
+ * specifically those with XE_VRAM_FLAGS_NEED64K.
+ *
+ * Other platforms may have BO's set to 64k physical placement,
+ * but can be mapped at 4k offsets anyway. This check is only
+ * there for the former case.
+ */
+ if ((bo->flags & XE_BO_FLAG_INTERNAL_64K) &&
+ (xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K)) {
if (XE_IOCTL_DBG(xe, obj_offset &
XE_64K_PAGE_MASK) ||
XE_IOCTL_DBG(xe, addr & XE_64K_PAGE_MASK) ||