* [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile.
@ 2023-11-09 15:07 Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper Maarten Lankhorst
` (11 more replies)
0 siblings, 12 replies; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe
New version, splitting it up into smaller changes. Hopefully this version flows better.
The set_deadline changes have been dropped for now, but it should work as intended.
First patch should go into i915 and is on the ML, after that some fixups and reverts.
After that we update headers, add a FIXME, and then split out fbdev, intel_fb and
i915_gem_object_get_dma_address.
Maarten Lankhorst (9):
drm/i915: Use drm_atomic_helper_wait_for_fences helper.
fixup! drm/xe/display: Implement display support
drm/i915/display: Revert all before remaining changes to make xe
compile
drm/i915/display: Revert remaining changes to make xe compile
drm/xe: Update headers to be more compatible with i915
FIXME drm/i915/display: add_dma_resv_fences is i915 only
drm/i915/display: Use i915_gem_object_get_dma_address to get dma
address
FIXME drm/i915/display: Minimal changes to fbdev to make xe work
FIXME drm/i915/display: Make intel_fb.c code compatible with xe
.../gpu/drm/i915/display/intel_atomic_plane.c | 13 +--
drivers/gpu/drm/i915/display/intel_cursor.c | 12 +--
drivers/gpu/drm/i915/display/intel_display.c | 58 +---------
.../drm/i915/display/intel_display_types.h | 4 -
drivers/gpu/drm/i915/display/intel_fb.c | 89 ++++++----------
drivers/gpu/drm/i915/display/intel_fbc.c | 13 ++-
drivers/gpu/drm/i915/display/intel_fbdev.c | 100 ++++++------------
.../gpu/drm/i915/display/intel_frontbuffer.c | 7 +-
.../gpu/drm/i915/display/intel_frontbuffer.h | 4 -
.../drm/i915/display/skl_universal_plane.c | 4 -
.../compat-i915-headers/gem/i915_gem_lmem.h | 2 +
.../compat-i915-headers/gem/i915_gem_mman.h | 17 +++
.../compat-i915-headers/gem/i915_gem_object.h | 76 +++++++++++++
.../gem/i915_gem_object_frontbuffer.h | 4 +-
.../drm/xe/compat-i915-headers/i915_config.h | 19 ----
.../xe/compat-i915-headers/i915_gem_stolen.h | 13 ++-
.../gpu/drm/xe/compat-i915-headers/i915_vma.h | 6 ++
17 files changed, 205 insertions(+), 236 deletions(-)
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_mman.h
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
delete mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
--
2.39.2
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper.
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-10 11:33 ` [Intel-xe] [1/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 2/9] fixup! drm/xe/display: Implement display support Maarten Lankhorst
` (10 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe; +Cc: Maarten Lankhorst
From: Maarten Lankhorst <dev@lankhorst.se>
The fence api specifies you should wait for fence to completion, not
give up after whatever timeout was originally configured. The fences
themselves should prevent the timeout from being indefinite.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
.../gpu/drm/i915/display/intel_atomic_plane.c | 1 -
drivers/gpu/drm/i915/display/intel_display.c | 23 +------------------
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 77e281bf4cb5f..14eeb42c9e2a3 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -38,7 +38,6 @@
#include <drm/drm_blend.h>
#include <drm/drm_fourcc.h>
-#include "i915_config.h"
#include "i915_reg.h"
#include "intel_atomic_plane.h"
#include "intel_cdclk.h"
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index b27b533f03d6e..82ff5309a0629 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -50,7 +50,6 @@
#include "g4x_dp.h"
#include "g4x_hdmi.h"
#include "hsw_ips.h"
-#include "i915_config.h"
#include "i915_drv.h"
#include "i915_reg.h"
#include "i915_utils.h"
@@ -7055,26 +7054,6 @@ void intel_atomic_helper_free_state_worker(struct work_struct *work)
intel_atomic_helper_free_state(dev_priv);
}
-static void intel_atomic_commit_fence_wait(struct intel_atomic_state *intel_state)
-{
- struct drm_i915_private *i915 = to_i915(intel_state->base.dev);
- struct drm_plane *plane;
- struct drm_plane_state *new_plane_state;
- int ret, i;
-
- for_each_new_plane_in_state(&intel_state->base, plane, new_plane_state, i) {
- if (new_plane_state->fence) {
- ret = dma_fence_wait_timeout(new_plane_state->fence, false,
- i915_fence_timeout(i915));
- if (ret <= 0)
- break;
-
- dma_fence_put(new_plane_state->fence);
- new_plane_state->fence = NULL;
- }
- }
-}
-
static void intel_atomic_cleanup_work(struct work_struct *work)
{
struct intel_atomic_state *state =
@@ -7180,7 +7159,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
intel_wakeref_t wakeref = 0;
int i;
- intel_atomic_commit_fence_wait(state);
+ drm_atomic_helper_wait_for_fences(dev, &state->base, false);
drm_atomic_helper_wait_for_dependencies(&state->base);
drm_dp_mst_atomic_wait_for_dependencies(&state->base);
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 2/9] fixup! drm/xe/display: Implement display support
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 3/9] drm/i915/display: Revert all before remaining changes to make xe compile Maarten Lankhorst
` (9 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe; +Cc: Maarten Lankhorst
From: Maarten Lankhorst <dev@lankhorst.se>
With the previous commit, i915_config.h is no longer used.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
| 19 -------------------
1 file changed, 19 deletions(-)
delete mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
deleted file mode 100644
index e835bea08d1bd..0000000000000
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2023 Intel Corporation
- */
-
-#ifndef __I915_CONFIG_H__
-#define __I915_CONFIG_H__
-
-#include <linux/sched.h>
-
-struct drm_i915_private;
-
-static inline unsigned long
-i915_fence_timeout(const struct drm_i915_private *i915)
-{
- return MAX_SCHEDULE_TIMEOUT;
-}
-
-#endif /* __I915_CONFIG_H__ */
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 3/9] drm/i915/display: Revert all before remaining changes to make xe compile
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 2/9] fixup! drm/xe/display: Implement display support Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-10 11:41 ` [Intel-xe] [3/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 4/9] drm/i915/display: Revert " Maarten Lankhorst
` (8 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe; +Cc: Maarten Lankhorst
From: Maarten Lankhorst <dev@lankhorst.se>
drm/xe/display: Allow scanout of bos that can be migrated to lmem
drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base
Can probably be slightly ignored by squashing with next patch, at least
for intel_bo_to_drm_bo part.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
drivers/gpu/drm/i915/display/intel_fb.c | 9 ++--
drivers/gpu/drm/i915/display/intel_fbdev.c | 48 ++++++++--------------
2 files changed, 22 insertions(+), 35 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 1ce61245728a7..bf275b2692b8f 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -1964,10 +1964,10 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
if (!atomic_read(&front->bits))
return 0;
- if (dma_resv_test_signaled(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false)))
+ if (dma_resv_test_signaled(obj->base.resv, dma_resv_usage_rw(false)))
goto flush;
- ret = dma_resv_get_singleton(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false),
+ ret = dma_resv_get_singleton(obj->base.resv, dma_resv_usage_rw(false),
&fence);
if (ret || !fence)
goto flush;
@@ -2227,9 +2227,8 @@ intel_user_framebuffer_create(struct drm_device *dev,
return ERR_PTR(-ENOENT);
obj = gem_to_xe_bo(gem);
- /* Require vram placement or dma-buf import */
- if (IS_DGFX(i915) &&
- !xe_bo_can_migrate(gem_to_xe_bo(gem), XE_PL_VRAM0) &&
+ /* Require vram exclusive objects, but allow dma-buf imports */
+ if (IS_DGFX(i915) && obj->flags & XE_BO_CREATE_SYSTEM_BIT &&
obj->ttm.type != ttm_bo_type_sg) {
drm_gem_object_put(gem);
return ERR_PTR(-EREMOTE);
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index b7976706bc681..28b9aa9d52c26 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -48,7 +48,6 @@
#include "gem/i915_gem_mman.h"
#else
#include "xe_gt.h"
-#include "xe_ttm_stolen_mgr.h"
#endif
#include "i915_drv.h"
@@ -193,8 +192,8 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
size = mode_cmd.pitches[0] * mode_cmd.height;
size = PAGE_ALIGN(size);
- obj = ERR_PTR(-ENODEV);
#ifdef I915
+ obj = ERR_PTR(-ENODEV);
if (HAS_LMEM(dev_priv)) {
obj = i915_gem_object_create_lmem(dev_priv, size,
I915_BO_ALLOC_CONTIGUOUS |
@@ -213,23 +212,11 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
obj = i915_gem_object_create_shmem(dev_priv, size);
}
#else
- if (!IS_DGFX(dev_priv)) {
- obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv),
- NULL, size,
- ttm_bo_type_kernel, XE_BO_SCANOUT_BIT |
- XE_BO_CREATE_STOLEN_BIT |
- XE_BO_CREATE_PINNED_BIT);
- if (!IS_ERR(obj))
- drm_info(&dev_priv->drm, "Allocated fbdev into stolen\n");
- else
- drm_info(&dev_priv->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj));
- }
- if (IS_ERR(obj)) {
- obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv), NULL, size,
- ttm_bo_type_kernel, XE_BO_SCANOUT_BIT |
- XE_BO_CREATE_VRAM_IF_DGFX(xe_device_get_root_tile(dev_priv)) |
- XE_BO_CREATE_PINNED_BIT);
- }
+ /* XXX: Care about stolen? */
+ obj = xe_bo_create_pin_map(dev_priv, to_gt(dev_priv), NULL, size,
+ ttm_bo_type_kernel,
+ XE_BO_CREATE_VRAM_IF_DGFX(to_gt(dev_priv)) |
+ XE_BO_CREATE_PINNED_BIT | XE_BO_SCANOUT_BIT);
#endif
if (IS_ERR(obj)) {
@@ -365,23 +352,24 @@ static int intelfb_create(struct drm_fb_helper *helper,
}
#else
- if (!(obj->flags & XE_BO_CREATE_SYSTEM_BIT)) {
- if (obj->flags & XE_BO_CREATE_STOLEN_BIT)
- info->fix.smem_start = xe_ttm_stolen_io_offset(obj, 0);
- else
- info->fix.smem_start =
- pci_resource_start(pdev, 2) +
- xe_bo_addr(obj, 0, XE_PAGE_SIZE);
+ /* XXX: Could be pure fiction.. */
+ if (obj->flags & XE_BO_CREATE_VRAM0_BIT) {
+ struct xe_gt *gt = to_gt(dev_priv);
+ bool lmem;
+ info->fix.smem_start =
+ (unsigned long)(gt->mem.vram.io_start + xe_bo_addr(obj, 0, 4096, &lmem));
info->fix.smem_len = obj->ttm.base.size;
+
} else {
- /* XXX: Pure fiction, as the BO may not be physically accessible.. */
- info->fix.smem_start = 0;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+
+ info->fix.smem_start = pci_resource_start(pdev, 2) + xe_bo_ggtt_addr(obj);
info->fix.smem_len = obj->ttm.base.size;
}
- XE_WARN_ON(iosys_map_is_null(&obj->vmap));
- vaddr = obj->vmap.vaddr_iomem;
+ /* TODO: ttm_bo_kmap? */
+ vaddr = obj->vmap.vaddr;
#endif
if (IS_ERR(vaddr)) {
drm_err(&dev_priv->drm,
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 4/9] drm/i915/display: Revert remaining changes to make xe compile
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (2 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 3/9] drm/i915/display: Revert all before remaining changes to make xe compile Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 5/9] drm/xe: Update headers to be more compatible with i915 Maarten Lankhorst
` (7 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe
Should be split out instead. This should effectively revert the complete
patch.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
.../gpu/drm/i915/display/intel_atomic_plane.c | 8 +-
drivers/gpu/drm/i915/display/intel_cursor.c | 8 +-
drivers/gpu/drm/i915/display/intel_display.c | 35 -------
.../drm/i915/display/intel_display_types.h | 4 -
drivers/gpu/drm/i915/display/intel_fb.c | 81 +++-------------
drivers/gpu/drm/i915/display/intel_fbc.c | 13 ++-
drivers/gpu/drm/i915/display/intel_fbdev.c | 95 ++-----------------
.../gpu/drm/i915/display/intel_frontbuffer.c | 7 +-
.../gpu/drm/i915/display/intel_frontbuffer.h | 4 -
.../drm/i915/display/skl_universal_plane.c | 4 -
10 files changed, 40 insertions(+), 219 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 14eeb42c9e2a3..ef553270c0796 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -1069,10 +1069,10 @@ static int
intel_prepare_plane_fb(struct drm_plane *_plane,
struct drm_plane_state *_new_plane_state)
{
- struct intel_plane_state *new_plane_state =
- to_intel_plane_state(_new_plane_state);
struct i915_sched_attr attr = { .priority = I915_PRIORITY_DISPLAY };
struct intel_plane *plane = to_intel_plane(_plane);
+ struct intel_plane_state *new_plane_state =
+ to_intel_plane_state(_new_plane_state);
struct intel_atomic_state *state =
to_intel_atomic_state(new_plane_state->uapi.state);
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
@@ -1156,9 +1156,9 @@ intel_cleanup_plane_fb(struct drm_plane *plane,
{
struct intel_plane_state *old_plane_state =
to_intel_plane_state(_old_plane_state);
- __maybe_unused struct intel_atomic_state *state =
+ struct intel_atomic_state *state =
to_intel_atomic_state(old_plane_state->uapi.state);
- __maybe_unused struct drm_i915_private *dev_priv = to_i915(plane->dev);
+ struct drm_i915_private *dev_priv = to_i915(plane->dev);
struct drm_i915_gem_object *obj = intel_fb_obj(old_plane_state->hw.fb);
if (!obj)
diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
index 8ed8a623fa98b..b342fad180ca5 100644
--- a/drivers/gpu/drm/i915/display/intel_cursor.c
+++ b/drivers/gpu/drm/i915/display/intel_cursor.c
@@ -30,17 +30,15 @@ static const u32 intel_cursor_formats[] = {
static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
{
- __maybe_unused struct drm_i915_private *dev_priv =
+ struct drm_i915_private *dev_priv =
to_i915(plane_state->uapi.plane->dev);
- __maybe_unused const struct drm_framebuffer *fb = plane_state->hw.fb;
- __maybe_unused const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
+ const struct drm_framebuffer *fb = plane_state->hw.fb;
+ const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
u32 base;
-#ifdef I915
if (DISPLAY_INFO(dev_priv)->cursor_needs_physical)
base = sg_dma_address(obj->mm.pages->sgl);
else
-#endif
base = intel_plane_ggtt_offset(plane_state);
return base + plane_state->view.color_plane[0].offset;
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 82ff5309a0629..28992f368b383 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -42,10 +42,8 @@
#include <drm/drm_probe_helper.h>
#include <drm/drm_rect.h>
-#ifdef I915
#include "gem/i915_gem_lmem.h"
#include "gem/i915_gem_object.h"
-#endif
#include "g4x_dp.h"
#include "g4x_hdmi.h"
@@ -7073,39 +7071,6 @@ static void intel_atomic_cleanup_work(struct work_struct *work)
intel_atomic_helper_free_state(i915);
}
-#ifndef I915
-static int i915_gem_object_read_from_page(struct xe_bo *bo,
- u32 ofs, u64 *ptr, u32 size)
-{
- struct ttm_bo_kmap_obj map;
- void *virtual;
- bool is_iomem;
- int ret;
-
- XE_WARN_ON(size != 8);
-
- ret = xe_bo_lock(bo, true);
- if (ret)
- return ret;
-
- ret = ttm_bo_kmap(&bo->ttm, ofs >> PAGE_SHIFT, 1, &map);
- if (ret)
- goto out_unlock;
-
- ofs &= ~PAGE_MASK;
- virtual = ttm_kmap_obj_virtual(&map, &is_iomem);
- if (is_iomem)
- *ptr = readq((void __iomem *)(virtual + ofs));
- else
- *ptr = *(u64 *)(virtual + ofs);
-
- ttm_bo_kunmap(&map);
-out_unlock:
- xe_bo_unlock(bo);
- return ret;
-}
-#endif
-
static void intel_atomic_prepare_plane_clear_colors(struct intel_atomic_state *state)
{
struct drm_i915_private *i915 = to_i915(state->base.dev);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index b5e4b94c129b6..fa285c1f28223 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -2111,11 +2111,7 @@ intel_crtc_needs_color_update(const struct intel_crtc_state *crtc_state)
static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state)
{
-#ifdef I915
return i915_ggtt_offset(plane_state->ggtt_vma);
-#else
- return plane_state->ggtt_vma->node.start;
-#endif
}
static inline struct intel_frontbuffer *
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index bf275b2692b8f..f1cbd026f91f9 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -4,7 +4,6 @@
*/
#include <drm/drm_blend.h>
-#include <drm/drm_damage_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_modeset_helper.h>
@@ -17,17 +16,6 @@
#include "intel_dpt.h"
#include "intel_fb.h"
#include "intel_frontbuffer.h"
-#include "intel_frontbuffer.h"
-
-#ifdef I915
-/*
- * i915 requires obj->__do_not_access.base,
- * xe uses obj->ttm.base
- */
-#define ttm __do_not_access
-#else
-#include <drm/ttm/ttm_bo.h>
-#endif
#define check_array_bounds(i915, a, i) drm_WARN_ON(&(i915)->drm, (i) >= ARRAY_SIZE(a))
@@ -749,7 +737,6 @@ intel_fb_align_height(const struct drm_framebuffer *fb,
return ALIGN(height, tile_height);
}
-#ifdef I915
static unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier)
{
u8 tiling_caps = lookup_modifier(fb_modifier)->plane_caps &
@@ -769,7 +756,6 @@ static unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier)
return I915_TILING_NONE;
}
}
-#endif
bool intel_fb_modifier_uses_dpt(struct drm_i915_private *i915, u64 modifier)
{
@@ -1293,6 +1279,7 @@ static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int color_plane,
int plane_width, int *x, int *y)
{
+ struct drm_i915_gem_object *obj = intel_fb_obj(&fb->base);
int ret;
ret = intel_fb_offset_to_xy(x, y, &fb->base, color_plane);
@@ -1316,15 +1303,13 @@ static int convert_plane_offset_to_xy(const struct intel_framebuffer *fb, int co
* fb layout agrees with the fence layout. We already check that the
* fb stride matches the fence stride elsewhere.
*/
-#ifdef I915
- if (color_plane == 0 && i915_gem_object_is_tiled(intel_fb_obj(&fb->base)) &&
+ if (color_plane == 0 && i915_gem_object_is_tiled(obj) &&
(*x + plane_width) * fb->base.format->cpp[color_plane] > fb->base.pitches[color_plane]) {
drm_dbg_kms(fb->base.dev,
"bad fb plane %d offset: 0x%x\n",
color_plane, fb->base.offsets[color_plane]);
return -EINVAL;
}
-#endif
return 0;
}
@@ -1672,10 +1657,10 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *
max_size = max(max_size, offset + size);
}
- if (mul_u32_u32(max_size, tile_size) > obj->ttm.base.size) {
+ if (mul_u32_u32(max_size, tile_size) > obj->base.size) {
drm_dbg_kms(&i915->drm,
"fb too big for bo (need %llu bytes, have %zu bytes)\n",
- mul_u32_u32(max_size, tile_size), obj->ttm.base.size);
+ mul_u32_u32(max_size, tile_size), obj->base.size);
return -EINVAL;
}
@@ -1922,16 +1907,15 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
unsigned int *handle)
{
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
+ struct drm_i915_private *i915 = to_i915(obj->base.dev);
-#ifdef I915
if (i915_gem_object_is_userptr(obj)) {
- drm_dbg(fb->dev,
+ drm_dbg(&i915->drm,
"attempting to use a userptr for a framebuffer, denied\n");
return -EINVAL;
}
-#endif
- return drm_gem_handle_create(file, &obj->ttm.base, handle);
+ return drm_gem_handle_create(file, &obj->base, handle);
}
struct frontbuffer_fence_cb {
@@ -2009,20 +1993,17 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
struct drm_i915_gem_object *obj,
struct drm_mode_fb_cmd2 *mode_cmd)
{
- struct drm_i915_private *dev_priv = to_i915(obj->ttm.base.dev);
+ struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
struct drm_framebuffer *fb = &intel_fb->base;
u32 max_stride;
+ unsigned int tiling, stride;
int ret = -EINVAL;
int i;
-#ifdef I915
- unsigned tiling, stride;
-#endif
intel_fb->frontbuffer = intel_frontbuffer_get(obj);
if (!intel_fb->frontbuffer)
return -ENOMEM;
-#ifdef I915
i915_gem_object_lock(obj, NULL);
tiling = i915_gem_object_get_tiling(obj);
stride = i915_gem_object_get_stride(obj);
@@ -2048,27 +2029,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
goto err;
}
}
-#else
- ret = ttm_bo_reserve(&obj->ttm, true, false, NULL);
- if (ret)
- goto err;
- ret = -EINVAL;
-
- if (!(obj->flags & XE_BO_SCANOUT_BIT)) {
- /*
- * XE_BO_SCANOUT_BIT should ideally be set at creation, or is
- * automatically set when creating FB. We cannot change caching
- * mode when the object is VM_BINDed, so we can only set
- * coherency with display when unbound.
- */
- if (XE_IOCTL_DBG(dev_priv, !list_empty(&obj->ttm.base.gpuva.list))) {
- ttm_bo_unreserve(&obj->ttm);
- goto err;
- }
- obj->flags |= XE_BO_SCANOUT_BIT;
- }
- ttm_bo_unreserve(&obj->ttm);
-#endif
if (!drm_any_plane_has_format(&dev_priv->drm,
mode_cmd->pixel_format,
@@ -2079,7 +2039,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
goto err;
}
-#ifdef I915
/*
* gen2/3 display engine uses the fence if present,
* so the tiling mode must match the fb modifier exactly.
@@ -2090,7 +2049,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
"tiling_mode must match fb modifier exactly on gen2/3\n");
goto err;
}
-#endif
max_stride = intel_fb_max_stride(dev_priv, mode_cmd->pixel_format,
mode_cmd->modifier[0]);
@@ -2103,7 +2061,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
goto err;
}
-#ifdef I915
/*
* If there's a fence, enforce that
* the fb pitch and fence stride match.
@@ -2114,7 +2071,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
mode_cmd->pitches[0], stride);
goto err;
}
-#endif
/* FIXME need to adjust LINOFF/TILEOFF accordingly. */
if (mode_cmd->offsets[0] != 0) {
@@ -2207,36 +2163,23 @@ intel_user_framebuffer_create(struct drm_device *dev,
struct drm_framebuffer *fb;
struct drm_i915_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
- struct drm_i915_private *i915 = to_i915(dev);
+ struct drm_i915_private *i915;
-#ifdef I915
obj = i915_gem_object_lookup(filp, mode_cmd.handles[0]);
if (!obj)
return ERR_PTR(-ENOENT);
/* object is backed with LMEM for discrete */
+ i915 = to_i915(obj->base.dev);
if (HAS_LMEM(i915) && !i915_gem_object_can_migrate(obj, INTEL_REGION_LMEM_0)) {
/* object is "remote", not in local memory */
i915_gem_object_put(obj);
drm_dbg_kms(&i915->drm, "framebuffer must reside in local memory\n");
return ERR_PTR(-EREMOTE);
}
-#else
- struct drm_gem_object *gem = drm_gem_object_lookup(filp, mode_cmd.handles[0]);
- if (!gem)
- return ERR_PTR(-ENOENT);
-
- obj = gem_to_xe_bo(gem);
- /* Require vram exclusive objects, but allow dma-buf imports */
- if (IS_DGFX(i915) && obj->flags & XE_BO_CREATE_SYSTEM_BIT &&
- obj->ttm.type != ttm_bo_type_sg) {
- drm_gem_object_put(gem);
- return ERR_PTR(-EREMOTE);
- }
-#endif
fb = intel_framebuffer_create(obj, &mode_cmd);
- drm_gem_object_put(&obj->ttm.base);
+ i915_gem_object_put(obj);
return fb;
}
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 1152bd4cb8f84..15721fb2ef5d8 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -453,7 +453,6 @@ static void g4x_fbc_program_cfb(struct intel_fbc *fbc)
intel_de_write(i915, DPFC_CB_BASE,
i915_gem_stolen_node_offset(&fbc->compressed_fb));
-
}
static const struct intel_fbc_funcs g4x_fbc_funcs = {
@@ -612,8 +611,10 @@ static void ivb_fbc_activate(struct intel_fbc *fbc)
else if (DISPLAY_VER(i915) == 9)
skl_fbc_program_cfb_stride(fbc);
+#ifdef I915
if (intel_gt_support_legacy_fencing(to_gt(i915)))
snb_fbc_program_fence(fbc);
+#endif
intel_de_write(i915, ILK_DPFC_CONTROL(fbc->id),
DPFC_CTL_EN | ivb_dpfc_ctl(fbc));
@@ -800,7 +801,6 @@ static int intel_fbc_alloc_cfb(struct intel_fbc *fbc,
drm_dbg_kms(&i915->drm,
"reserved %llu bytes of contiguous stolen space for FBC, limit: %d\n",
i915_gem_stolen_node_size(&fbc->compressed_fb), fbc->limit);
-
return 0;
err_llb:
@@ -978,7 +978,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
struct intel_crtc *crtc,
struct intel_plane *plane)
{
- struct drm_i915_private *i915 = to_i915(state->base.dev);
+ __maybe_unused struct drm_i915_private *i915 = to_i915(state->base.dev);
const struct intel_crtc_state *crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
const struct intel_plane_state *plane_state =
@@ -993,7 +993,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
/* FBC1 compression interval: arbitrary choice of 1 second */
fbc_state->interval = drm_mode_vrefresh(&crtc_state->hw.adjusted_mode);
-
+#ifdef I915
fbc_state->fence_y_offset = intel_plane_fence_y_offset(plane_state);
drm_WARN_ON(&i915->drm, plane_state->flags & PLANE_HAS_FENCE &&
@@ -1002,6 +1002,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
if (plane_state->flags & PLANE_HAS_FENCE)
fbc_state->fence_id = i915_vma_fence_id(plane_state->ggtt_vma);
else
+#endif
fbc_state->fence_id = -1;
fbc_state->cfb_stride = intel_fbc_cfb_stride(plane_state);
@@ -1011,6 +1012,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
static bool intel_fbc_is_fence_ok(const struct intel_plane_state *plane_state)
{
+#ifdef I915
struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
/*
@@ -1028,6 +1030,9 @@ static bool intel_fbc_is_fence_ok(const struct intel_plane_state *plane_state)
return DISPLAY_VER(i915) >= 9 ||
(plane_state->flags & PLANE_HAS_FENCE &&
i915_vma_fence_id(plane_state->ggtt_vma) != -1);
+#else
+ return true;
+#endif
}
static bool intel_fbc_is_cfb_ok(const struct intel_plane_state *plane_state)
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 28b9aa9d52c26..31d0d695d5671 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -43,12 +43,8 @@
#include <drm/drm_fourcc.h>
#include <drm/drm_gem_framebuffer_helper.h>
-#ifdef I915
#include "gem/i915_gem_lmem.h"
#include "gem/i915_gem_mman.h"
-#else
-#include "xe_gt.h"
-#endif
#include "i915_drv.h"
#include "intel_display_types.h"
@@ -57,14 +53,6 @@
#include "intel_fbdev.h"
#include "intel_frontbuffer.h"
-#ifdef I915
-/*
- * i915 requires obj->__do_not_access.base,
- * xe uses obj->ttm.base
- */
-#define ttm __do_not_access
-#endif
-
struct intel_fbdev {
struct drm_fb_helper helper;
struct intel_framebuffer *fb;
@@ -142,13 +130,9 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct intel_fbdev *fbdev = to_intel_fbdev(info->par);
struct drm_gem_object *bo = drm_gem_fb_get_obj(&fbdev->fb->base, 0);
-#ifdef I915
struct drm_i915_gem_object *obj = to_intel_bo(bo);
return i915_gem_fb_mmap(obj, vma);
-#else
- return drm_gem_prime_mmap(bo, vma);
-#endif
}
static const struct fb_ops intelfb_ops = {
@@ -180,19 +164,14 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
mode_cmd.width = sizes->surface_width;
mode_cmd.height = sizes->surface_height;
-#ifdef I915
mode_cmd.pitches[0] = ALIGN(mode_cmd.width *
DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
-#else
- mode_cmd.pitches[0] = ALIGN(mode_cmd.width *
- DIV_ROUND_UP(sizes->surface_bpp, 8), XE_PAGE_SIZE);
-#endif
mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
sizes->surface_depth);
size = mode_cmd.pitches[0] * mode_cmd.height;
size = PAGE_ALIGN(size);
-#ifdef I915
+
obj = ERR_PTR(-ENODEV);
if (HAS_LMEM(dev_priv)) {
obj = i915_gem_object_create_lmem(dev_priv, size,
@@ -211,13 +190,6 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
if (IS_ERR(obj))
obj = i915_gem_object_create_shmem(dev_priv, size);
}
-#else
- /* XXX: Care about stolen? */
- obj = xe_bo_create_pin_map(dev_priv, to_gt(dev_priv), NULL, size,
- ttm_bo_type_kernel,
- XE_BO_CREATE_VRAM_IF_DGFX(to_gt(dev_priv)) |
- XE_BO_CREATE_PINNED_BIT | XE_BO_SCANOUT_BIT);
-#endif
if (IS_ERR(obj)) {
drm_err(&dev_priv->drm, "failed to allocate framebuffer (%pe)\n", obj);
@@ -225,16 +197,10 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
}
fb = intel_framebuffer_create(obj, &mode_cmd);
- if (IS_ERR(fb)) {
-#ifdef I915
- i915_gem_object_put(obj);
-#else
- xe_bo_unpin_map_no_vm(obj);
-#endif
+ i915_gem_object_put(obj);
+ if (IS_ERR(fb))
return PTR_ERR(fb);
- }
- drm_gem_object_put(&obj->ttm.base);
ifbdev->fb = to_intel_framebuffer(fb);
return 0;
}
@@ -247,6 +213,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
struct drm_device *dev = helper->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+ struct i915_ggtt *ggtt = to_gt(dev_priv)->ggtt;
const struct i915_gtt_view view = {
.type = I915_GTT_VIEW_NORMAL,
};
@@ -257,10 +224,8 @@ static int intelfb_create(struct drm_fb_helper *helper,
bool prealloc = false;
void __iomem *vaddr;
struct drm_i915_gem_object *obj;
- int ret;
-#ifdef I915
struct i915_gem_ww_ctx ww;
-#endif
+ int ret;
mutex_lock(&ifbdev->hpd_lock);
ret = ifbdev->hpd_suspended ? -EAGAIN : 0;
@@ -318,7 +283,6 @@ static int intelfb_create(struct drm_fb_helper *helper,
info->fbops = &intelfb_ops;
obj = intel_fb_obj(&intel_fb->base);
-#ifdef I915
if (i915_gem_object_is_lmem(obj)) {
struct intel_memory_region *mem = obj->mm.region;
@@ -328,8 +292,6 @@ static int intelfb_create(struct drm_fb_helper *helper,
i915_gem_object_get_dma_address(obj, 0));
info->fix.smem_len = obj->base.size;
} else {
- struct i915_ggtt *ggtt = to_gt(dev_priv)->ggtt;
-
/* Our framebuffer is the entirety of fbdev's system memory */
info->fix.smem_start =
(unsigned long)(ggtt->gmadr.start + i915_ggtt_offset(vma));
@@ -351,38 +313,11 @@ static int intelfb_create(struct drm_fb_helper *helper,
}
}
-#else
- /* XXX: Could be pure fiction.. */
- if (obj->flags & XE_BO_CREATE_VRAM0_BIT) {
- struct xe_gt *gt = to_gt(dev_priv);
- bool lmem;
-
- info->fix.smem_start =
- (unsigned long)(gt->mem.vram.io_start + xe_bo_addr(obj, 0, 4096, &lmem));
- info->fix.smem_len = obj->ttm.base.size;
-
- } else {
- struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
-
- info->fix.smem_start = pci_resource_start(pdev, 2) + xe_bo_ggtt_addr(obj);
- info->fix.smem_len = obj->ttm.base.size;
- }
-
- /* TODO: ttm_bo_kmap? */
- vaddr = obj->vmap.vaddr;
-#endif
- if (IS_ERR(vaddr)) {
- drm_err(&dev_priv->drm,
- "Failed to remap framebuffer into virtual memory (%pe)\n", vaddr);
- ret = PTR_ERR(vaddr);
- goto out_unpin;
- }
-
if (ret)
goto out_unpin;
info->screen_base = vaddr;
- info->screen_size = obj->ttm.base.size;
+ info->screen_size = vma->size;
drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
@@ -390,23 +325,14 @@ static int intelfb_create(struct drm_fb_helper *helper,
* If the object is stolen however, it will be full of whatever
* garbage was left in there.
*/
-#ifdef I915
if (!i915_gem_object_is_shmem(vma->obj) && !prealloc)
-#else
- /* XXX: Check stolen bit? */
- if (!(obj->flags & XE_BO_CREATE_SYSTEM_BIT) && !prealloc)
-#endif
memset_io(info->screen_base, 0, info->screen_size);
/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
drm_dbg_kms(&dev_priv->drm, "allocated %dx%d fb: 0x%08x\n",
ifbdev->fb->base.width, ifbdev->fb->base.height,
-#ifdef I915
i915_ggtt_offset(vma));
-#else
- (u32)vma->node.start);
-#endif
ifbdev->vma = vma;
ifbdev->vma_flags = flags;
@@ -498,12 +424,12 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
continue;
}
- if (obj->ttm.base.size > max_size) {
+ if (obj->base.size > max_size) {
drm_dbg_kms(&i915->drm,
"found possible fb from [PLANE:%d:%s]\n",
plane->base.base.id, plane->base.name);
fb = to_intel_framebuffer(plane_state->uapi.fb);
- max_size = obj->ttm.base.size;
+ max_size = obj->base.size;
}
}
@@ -777,13 +703,8 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
* been restored from swap. If the object is stolen however, it will be
* full of whatever garbage was left in there.
*/
-#ifdef I915
if (state == FBINFO_STATE_RUNNING &&
!i915_gem_object_is_shmem(intel_fb_obj(&ifbdev->fb->base)))
-#else
- if (state == FBINFO_STATE_RUNNING &&
- !(intel_fb_obj(&ifbdev->fb->base)->flags & XE_BO_CREATE_SYSTEM_BIT))
-#endif
memset_io(info->screen_base, 0, info->screen_size);
drm_fb_helper_set_suspend(&ifbdev->helper, state);
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index d64ce5bfeca82..2ea37c0414a95 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -190,7 +190,7 @@ void __intel_fb_flush(struct intel_frontbuffer *front,
enum fb_op_origin origin,
unsigned int frontbuffer_bits)
{
- struct drm_i915_private *i915 = intel_bo_to_i915((front->obj));
+ struct drm_i915_private *i915 = intel_bo_to_i915(front->obj);
if (origin == ORIGIN_CS) {
spin_lock(&i915->display.fb_tracking.lock);
@@ -259,6 +259,7 @@ static void frontbuffer_release(struct kref *ref)
drm_WARN_ON(&intel_bo_to_i915(obj)->drm, atomic_read(&front->bits));
i915_ggtt_clear_scanout(obj);
+
ret = i915_gem_object_set_frontbuffer(obj, NULL);
drm_WARN_ON(&intel_bo_to_i915(obj)->drm, ret);
spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
@@ -289,12 +290,12 @@ intel_frontbuffer_get(struct drm_i915_gem_object *obj)
frontbuffer_retire,
I915_ACTIVE_RETIRE_SLEEPS);
INIT_WORK(&front->flush_work, intel_frontbuffer_flush_work);
+
spin_lock(&i915->display.fb_tracking.lock);
cur = i915_gem_object_set_frontbuffer(obj, front);
spin_unlock(&i915->display.fb_tracking.lock);
if (cur != front)
kfree(front);
-
return cur;
}
@@ -337,7 +338,7 @@ void intel_frontbuffer_track(struct intel_frontbuffer *old,
}
if (new) {
- drm_WARN_ON(&intel_bo_to_i915(old->obj)->drm,
+ drm_WARN_ON(&intel_bo_to_i915(new->obj)->drm,
atomic_read(&new->bits) & frontbuffer_bits);
atomic_or(frontbuffer_bits, &new->bits);
}
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.h b/drivers/gpu/drm/i915/display/intel_frontbuffer.h
index 00467d513e74d..abb51e8bb9200 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.h
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.h
@@ -28,10 +28,6 @@
#include <linux/bits.h>
#include <linux/kref.h>
-#ifndef I915
-#include "xe_bo.h"
-#endif
-
#include "i915_active_types.h"
struct drm_i915_private;
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 68eabe089aaf4..a24e66aa7ba44 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -2453,15 +2453,11 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
fb->modifier = DRM_FORMAT_MOD_LINEAR;
break;
case PLANE_CTL_TILED_X:
-#ifdef I915
plane_config->tiling = I915_TILING_X;
-#endif
fb->modifier = I915_FORMAT_MOD_X_TILED;
break;
case PLANE_CTL_TILED_Y:
-#ifdef I915
plane_config->tiling = I915_TILING_Y;
-#endif
if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
if (DISPLAY_VER(dev_priv) >= 14)
fb->modifier = I915_FORMAT_MOD_4_TILED_MTL_RC_CCS;
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 5/9] drm/xe: Update headers to be more compatible with i915
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (3 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 4/9] drm/i915/display: Revert " Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 6/9] FIXME drm/i915/display: add_dma_resv_fences is i915 only Maarten Lankhorst
` (6 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe
Add more compatibility changes to decrease delta with i915.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
| 2 +
| 17 +++++
| 76 +++++++++++++++++++
.../gem/i915_gem_object_frontbuffer.h | 4 +-
| 13 +++-
| 6 ++
6 files changed, 113 insertions(+), 5 deletions(-)
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_mman.h
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
--git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
new file mode 100644
index 0000000000000..2f55e7e951e8c
--- /dev/null
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
@@ -0,0 +1,2 @@
+/* Empty */
+
--git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_mman.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_mman.h
new file mode 100644
index 0000000000000..650ea2803a97c
--- /dev/null
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_mman.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _I915_GEM_MMAN_H_
+#define _I915_GEM_MMAN_H_
+
+#include "xe_bo_types.h"
+#include <drm/drm_prime.h>
+
+static inline int i915_gem_fb_mmap(struct xe_bo *bo, struct vm_area_struct *vma)
+{
+ return drm_gem_prime_mmap(&bo->ttm.base, vma);
+}
+
+#endif
--git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
new file mode 100644
index 0000000000000..17620412eddde
--- /dev/null
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
@@ -0,0 +1,76 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _I915_GEM_OBJECT_H_
+#define _I915_GEM_OBJECT_H_
+
+/* For tiling definitions */
+#include <uapi/drm/i915_drm.h>
+
+#undef I915_TILING_X
+#undef I915_TILING_Y
+#define I915_TILING_X 0
+#define I915_TILING_Y 0
+
+#include "xe_bo.h"
+#include <linux/types.h>
+
+static inline int i915_gem_object_read_from_page(struct xe_bo *bo,
+ u32 ofs, u64 *ptr, u32 size)
+{
+ struct ttm_bo_kmap_obj map;
+ void *virtual;
+ bool is_iomem;
+ int ret;
+
+ WARN_ON(size != 8);
+
+ ret = xe_bo_lock(bo, true);
+ if (ret)
+ return ret;
+
+ ret = ttm_bo_kmap(&bo->ttm, ofs >> PAGE_SHIFT, 1, &map);
+ if (ret)
+ goto out_unlock;
+
+ ofs &= ~PAGE_MASK;
+ virtual = ttm_kmap_obj_virtual(&map, &is_iomem);
+ if (is_iomem)
+ *ptr = readq((void __iomem *)(virtual + ofs));
+ else
+ *ptr = *(u64 *)(virtual + ofs);
+
+ ttm_bo_kunmap(&map);
+out_unlock:
+ xe_bo_unlock(bo);
+ return ret;
+}
+
+static inline dma_addr_t i915_gem_object_get_dma_address(const struct xe_bo *bo, pgoff_t n)
+{
+ /* Should never be called */
+ WARN_ON(1);
+ return n;
+}
+
+/* Useful for kernel managed objects only */
+static inline bool i915_gem_object_is_shmem(const struct xe_bo *bo)
+{
+ return bo->flags & XE_BO_CREATE_SYSTEM_BIT;
+}
+
+static inline bool i915_gem_object_is_tiled(const struct xe_bo *bo)
+{
+ /* legacy tiling is unused */
+ return false;
+}
+
+static inline bool i915_gem_object_is_userptr(const struct xe_bo *bo)
+{
+ /* legacy tiling is unused */
+ return false;
+}
+
+#endif
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
index 227965e5f7846..6d883aca48b6e 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
@@ -3,8 +3,8 @@
* Copyright © 2022 Intel Corporation
*/
-#ifndef _I915_GEM_OBJECT_H_
-#define _I915_GEM_OBJECT_H_
+#ifndef _I915_GEM_OBJECT_FB_H_
+#define _I915_GEM_OBJECT_FB_H_
#define i915_gem_object_get_frontbuffer(obj) NULL
#define i915_gem_object_set_frontbuffer(obj, front) (front)
--git a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
index 32f60258ded69..19bf463cfd3d2 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
@@ -1,5 +1,5 @@
-#ifndef _I915_GEM_OBJECT_H_
-#define _I915_GEM_OBJECT_H_
+#ifndef _I915_GEM_STOLEN_H_
+#define _I915_GEM_STOLEN_H_
#include "xe_ttm_stolen_mgr.h"
#include "xe_res_cursor.h"
@@ -70,7 +70,14 @@ static inline u32 i915_gem_stolen_node_offset(struct i915_stolen_fb *fb)
/* Used for < gen4. These are not supported by Xe */
#define i915_gem_stolen_area_address(xe) (!WARN_ON(1))
/* Used for gen9 specific WA. Gen9 is not supported by Xe */
-#define i915_gem_stolen_area_size(xe) (!WARN_ON(1))
+static inline u64 i915_gem_stolen_area_size(struct xe_device *xe)
+{
+ struct ttm_resource_manager *ttm_mgr = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
+
+ if (!ttm_mgr)
+ return 0;
+ return ttm_mgr->size;
+}
#define i915_gem_stolen_node_address(xe, fb) (xe_ttm_stolen_gpu_offset(xe) + \
i915_gem_stolen_node_offset(fb))
--git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
index 9424144b1b5aa..23f2d037c313e 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
@@ -19,4 +19,10 @@ struct i915_vma {
#define i915_ggtt_clear_scanout(bo) do { } while (0)
#define i915_vma_fence_id(vma) -1
+
+static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
+{
+ return vma->node.start;
+}
+
#endif
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 6/9] FIXME drm/i915/display: add_dma_resv_fences is i915 only
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (4 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 5/9] drm/xe: Update headers to be more compatible with i915 Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-10 11:56 ` [Intel-xe] [6/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 7/9] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address Maarten Lankhorst
` (5 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe; +Cc: Maarten Lankhorst
From: Maarten Lankhorst <dev@lankhorst.se>
I'm 99% sure that this code is no longer needed on i915, but I'm 100%
sure it won't be needed for xe.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
drivers/gpu/drm/i915/display/intel_atomic_plane.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index ef553270c0796..a5ee4af25836f 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -1021,9 +1021,10 @@ int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state)
static int add_dma_resv_fences(struct dma_resv *resv,
struct drm_plane_state *new_plane_state)
{
+ int ret = 0;
+#ifdef I915
struct dma_fence *fence = dma_fence_get(new_plane_state->fence);
struct dma_fence *new;
- int ret;
ret = dma_resv_get_singleton(resv, dma_resv_usage_rw(false), &new);
if (ret)
@@ -1050,6 +1051,7 @@ static int add_dma_resv_fences(struct dma_resv *resv,
error:
dma_fence_put(fence);
+#endif
return ret;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 7/9] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (5 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 6/9] FIXME drm/i915/display: add_dma_resv_fences is i915 only Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-10 12:02 ` [Intel-xe] [7/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 8/9] FIXME drm/i915/display: Minimal changes to fbdev to make xe work Maarten Lankhorst
` (4 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe
Works better for xe like that. obj is no longer const.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_cursor.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
index b342fad180ca5..0d21c34f74990 100644
--- a/drivers/gpu/drm/i915/display/intel_cursor.c
+++ b/drivers/gpu/drm/i915/display/intel_cursor.c
@@ -23,6 +23,8 @@
#include "intel_psr.h"
#include "skl_watermark.h"
+#include "gem/i915_gem_object.h"
+
/* Cursor formats */
static const u32 intel_cursor_formats[] = {
DRM_FORMAT_ARGB8888,
@@ -33,11 +35,11 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
struct drm_i915_private *dev_priv =
to_i915(plane_state->uapi.plane->dev);
const struct drm_framebuffer *fb = plane_state->hw.fb;
- const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
+ struct drm_i915_gem_object *obj = intel_fb_obj(fb);
u32 base;
if (DISPLAY_INFO(dev_priv)->cursor_needs_physical)
- base = sg_dma_address(obj->mm.pages->sgl);
+ base = i915_gem_object_get_dma_address(obj, 0);
else
base = intel_plane_ggtt_offset(plane_state);
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 8/9] FIXME drm/i915/display: Minimal changes to fbdev to make xe work
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (6 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 7/9] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 9/9] FIXME drm/i915/display: Make intel_fb.c code compatible with xe Maarten Lankhorst
` (3 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe
BO creation, allocation and placement is slightly different from i915 vs xe.
This is one of the few times we cannot hide between macros,
so make the most of it. :)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_fbdev.c | 79 +++++++++++++++++++---
1 file changed, 70 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 31d0d695d5671..f6cef1302cd20 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -45,6 +45,7 @@
#include "gem/i915_gem_lmem.h"
#include "gem/i915_gem_mman.h"
+#include "gem/i915_gem_object.h"
#include "i915_drv.h"
#include "intel_display_types.h"
@@ -173,6 +174,7 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
size = PAGE_ALIGN(size);
obj = ERR_PTR(-ENODEV);
+#ifdef I915
if (HAS_LMEM(dev_priv)) {
obj = i915_gem_object_create_lmem(dev_priv, size,
I915_BO_ALLOC_CONTIGUOUS |
@@ -185,11 +187,35 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
*
* Also skip stolen on MTL as Wa_22018444074 mitigation.
*/
- if (!(IS_METEORLAKE(dev_priv)) && size * 2 < dev_priv->dsm.usable_size)
+ if (!(IS_METEORLAKE(dev_priv)) &&
+ size * 2 < i915_gem_stolen_area_size(dev_priv))
obj = i915_gem_object_create_stolen(dev_priv, size);
if (IS_ERR(obj))
obj = i915_gem_object_create_shmem(dev_priv, size);
}
+#else
+ /*
+ * The semantics for xe_bo_create_pin_map are different from those
+ * of i915_gem_object_create_*(), and need to be destroyed with
+ * xe_bo_unpin_map_no_vm().
+ */
+ if (!IS_DGFX(dev_priv) && !IS_METEORLAKE(dev_priv) &&
+ size * 2 < i915_gem_stolen_area_size(dev_priv)) {
+ obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv),
+ NULL, size, ttm_bo_type_kernel,
+ XE_BO_CREATE_STOLEN_BIT |
+ XE_BO_CREATE_PINNED_BIT | XE_BO_SCANOUT_BIT);
+ if (!IS_ERR(obj))
+ drm_info(&dev_priv->drm, "Allocated fbdev into stolen\n");
+ else
+ drm_info(&dev_priv->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj));
+ }
+ if (IS_ERR(obj))
+ obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv),
+ NULL, size, ttm_bo_type_kernel,
+ XE_BO_CREATE_VRAM_IF_DGFX(xe_device_get_root_tile(dev_priv)) |
+ XE_BO_CREATE_PINNED_BIT | XE_BO_SCANOUT_BIT);
+#endif
if (IS_ERR(obj)) {
drm_err(&dev_priv->drm, "failed to allocate framebuffer (%pe)\n", obj);
@@ -197,10 +223,18 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
}
fb = intel_framebuffer_create(obj, &mode_cmd);
- i915_gem_object_put(obj);
- if (IS_ERR(fb))
+ if (IS_ERR(fb)) {
+#ifdef I915
+ i915_gem_object_put(obj);
+#else
+ /* undo pin/map, or we get a WARN */
+ xe_bo_unpin_map_no_vm(obj);
+#endif
return PTR_ERR(fb);
+ }
+ /* reference transferred to fb */
+ drm_gem_object_put(intel_bo_to_drm_bo(obj));
ifbdev->fb = to_intel_framebuffer(fb);
return 0;
}
@@ -213,7 +247,6 @@ static int intelfb_create(struct drm_fb_helper *helper,
struct drm_device *dev = helper->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
- struct i915_ggtt *ggtt = to_gt(dev_priv)->ggtt;
const struct i915_gtt_view view = {
.type = I915_GTT_VIEW_NORMAL,
};
@@ -224,8 +257,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
bool prealloc = false;
void __iomem *vaddr;
struct drm_i915_gem_object *obj;
- struct i915_gem_ww_ctx ww;
int ret;
+#ifdef I915
+ struct i915_gem_ww_ctx ww;
+#endif
mutex_lock(&ifbdev->hpd_lock);
ret = ifbdev->hpd_suspended ? -EAGAIN : 0;
@@ -283,6 +318,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
info->fbops = &intelfb_ops;
obj = intel_fb_obj(&intel_fb->base);
+#ifdef I915
if (i915_gem_object_is_lmem(obj)) {
struct intel_memory_region *mem = obj->mm.region;
@@ -292,6 +328,8 @@ static int intelfb_create(struct drm_fb_helper *helper,
i915_gem_object_get_dma_address(obj, 0));
info->fix.smem_len = obj->base.size;
} else {
+ struct i915_ggtt *ggtt = to_gt(dev_priv)->ggtt;
+
/* Our framebuffer is the entirety of fbdev's system memory */
info->fix.smem_start =
(unsigned long)(ggtt->gmadr.start + i915_ggtt_offset(vma));
@@ -312,12 +350,35 @@ static int intelfb_create(struct drm_fb_helper *helper,
continue;
}
}
+#else
+ if (obj->flags & XE_BO_CREATE_STOLEN_BIT) {
+ info->fix.smem_start = xe_ttm_stolen_io_offset(obj, 0);
+ } else {
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+
+ info->fix.smem_start = pci_resource_start(pdev, 2);
+ if (obj->flags & XE_BO_CREATE_VRAM0_BIT)
+ info->fix.smem_start += xe_bo_addr(obj, 0, XE_PAGE_SIZE);
+ else
+ info->fix.smem_start += xe_bo_ggtt_addr(obj);
+ }
+ info->fix.smem_len = obj->ttm.base.size;
+
+ XE_WARN_ON(iosys_map_is_null(&obj->vmap));
+ vaddr = obj->vmap.vaddr_iomem;
+#endif
+ if (IS_ERR(vaddr)) {
+ drm_err(&dev_priv->drm,
+ "Failed to remap framebuffer into virtual memory (%pe)\n", vaddr);
+ ret = PTR_ERR(vaddr);
+ goto out_unpin;
+ }
if (ret)
goto out_unpin;
info->screen_base = vaddr;
- info->screen_size = vma->size;
+ info->screen_size = intel_bo_to_drm_bo(obj)->size;
drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
@@ -325,7 +386,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
* If the object is stolen however, it will be full of whatever
* garbage was left in there.
*/
- if (!i915_gem_object_is_shmem(vma->obj) && !prealloc)
+ if (!i915_gem_object_is_shmem(obj) && !prealloc)
memset_io(info->screen_base, 0, info->screen_size);
/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
@@ -424,12 +485,12 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
continue;
}
- if (obj->base.size > max_size) {
+ if (intel_bo_to_drm_bo(obj)->size > max_size) {
drm_dbg_kms(&i915->drm,
"found possible fb from [PLANE:%d:%s]\n",
plane->base.base.id, plane->base.name);
fb = to_intel_framebuffer(plane_state->uapi.fb);
- max_size = obj->base.size;
+ max_size = intel_bo_to_drm_bo(obj)->size;
}
}
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] [PATCH 9/9] FIXME drm/i915/display: Make intel_fb.c code compatible with xe
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (7 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 8/9] FIXME drm/i915/display: Minimal changes to fbdev to make xe work Maarten Lankhorst
@ 2023-11-09 15:07 ` Maarten Lankhorst
2023-11-09 15:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile Patchwork
` (2 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Maarten Lankhorst @ 2023-11-09 15:07 UTC (permalink / raw)
To: intel-xe; +Cc: Maarten Lankhorst
From: Maarten Lankhorst <dev@lankhorst.se>
Again there are a few changes between Xe and i915, but in general code is similar for both
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
drivers/gpu/drm/i915/display/intel_fb.c | 85 +++++++++++++++++--------
1 file changed, 57 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index f1cbd026f91f9..aa41e681e835d 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -17,6 +17,8 @@
#include "intel_fb.h"
#include "intel_frontbuffer.h"
+#include "gem/i915_gem_object.h"
+
#define check_array_bounds(i915, a, i) drm_WARN_ON(&(i915)->drm, (i) >= ARRAY_SIZE(a))
/*
@@ -737,7 +739,7 @@ intel_fb_align_height(const struct drm_framebuffer *fb,
return ALIGN(height, tile_height);
}
-static unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier)
+__maybe_unused static unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier)
{
u8 tiling_caps = lookup_modifier(fb_modifier)->plane_caps &
INTEL_PLANE_CAP_TILING_MASK;
@@ -1657,10 +1659,10 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *
max_size = max(max_size, offset + size);
}
- if (mul_u32_u32(max_size, tile_size) > obj->base.size) {
+ if (mul_u32_u32(max_size, tile_size) > intel_bo_to_drm_bo(obj)->size) {
drm_dbg_kms(&i915->drm,
"fb too big for bo (need %llu bytes, have %zu bytes)\n",
- mul_u32_u32(max_size, tile_size), obj->base.size);
+ mul_u32_u32(max_size, tile_size), intel_bo_to_drm_bo(obj)->size);
return -EINVAL;
}
@@ -1907,7 +1909,7 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
unsigned int *handle)
{
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
- struct drm_i915_private *i915 = to_i915(obj->base.dev);
+ struct drm_i915_private *i915 = to_i915(fb->dev);
if (i915_gem_object_is_userptr(obj)) {
drm_dbg(&i915->drm,
@@ -1915,7 +1917,7 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
return -EINVAL;
}
- return drm_gem_handle_create(file, &obj->base, handle);
+ return drm_gem_handle_create(file, intel_bo_to_drm_bo(obj), handle);
}
struct frontbuffer_fence_cb {
@@ -1948,10 +1950,10 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
if (!atomic_read(&front->bits))
return 0;
- if (dma_resv_test_signaled(obj->base.resv, dma_resv_usage_rw(false)))
+ if (dma_resv_test_signaled(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false)))
goto flush;
- ret = dma_resv_get_singleton(obj->base.resv, dma_resv_usage_rw(false),
+ ret = dma_resv_get_singleton(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false),
&fence);
if (ret || !fence)
goto flush;
@@ -1993,10 +1995,10 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
struct drm_i915_gem_object *obj,
struct drm_mode_fb_cmd2 *mode_cmd)
{
- struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
+ struct drm_i915_private *dev_priv = intel_bo_to_i915(obj);
struct drm_framebuffer *fb = &intel_fb->base;
u32 max_stride;
- unsigned int tiling, stride;
+ unsigned int tiling = I915_TILING_NONE, stride = 0;
int ret = -EINVAL;
int i;
@@ -2004,6 +2006,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
if (!intel_fb->frontbuffer)
return -ENOMEM;
+#ifdef I915
i915_gem_object_lock(obj, NULL);
tiling = i915_gem_object_get_tiling(obj);
stride = i915_gem_object_get_stride(obj);
@@ -2030,15 +2033,6 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
}
}
- if (!drm_any_plane_has_format(&dev_priv->drm,
- mode_cmd->pixel_format,
- mode_cmd->modifier[0])) {
- drm_dbg_kms(&dev_priv->drm,
- "unsupported pixel format %p4cc / modifier 0x%llx\n",
- &mode_cmd->pixel_format, mode_cmd->modifier[0]);
- goto err;
- }
-
/*
* gen2/3 display engine uses the fence if present,
* so the tiling mode must match the fb modifier exactly.
@@ -2049,6 +2043,36 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
"tiling_mode must match fb modifier exactly on gen2/3\n");
goto err;
}
+#else
+ ret = ttm_bo_reserve(&obj->ttm, true, false, NULL);
+ if (ret)
+ goto err;
+ ret = -EINVAL;
+
+ if (!(obj->flags & XE_BO_SCANOUT_BIT)) {
+ /*
+ * XE_BO_SCANOUT_BIT should ideally be set at creation, or is
+ * automatically set when creating FB. We cannot change caching
+ * mode when the object is VM_BINDed, so we can only set
+ * coherency with display when unbound.
+ */
+ if (XE_IOCTL_DBG(dev_priv, !list_empty(&obj->ttm.base.gpuva.list))) {
+ ttm_bo_unreserve(&obj->ttm);
+ goto err;
+ }
+ obj->flags |= XE_BO_SCANOUT_BIT;
+ }
+ ttm_bo_unreserve(&obj->ttm);
+#endif
+
+ if (!drm_any_plane_has_format(&dev_priv->drm,
+ mode_cmd->pixel_format,
+ mode_cmd->modifier[0])) {
+ drm_dbg_kms(&dev_priv->drm,
+ "unsupported pixel format %p4cc / modifier 0x%llx\n",
+ &mode_cmd->pixel_format, mode_cmd->modifier[0]);
+ goto err;
+ }
max_stride = intel_fb_max_stride(dev_priv, mode_cmd->pixel_format,
mode_cmd->modifier[0]);
@@ -2111,11 +2135,7 @@ int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
}
}
-#ifdef I915
- fb->obj[i] = &obj->base;
-#else
- fb->obj[i] = &obj->ttm.base;
-#endif
+ fb->obj[i] = intel_bo_to_drm_bo(obj);
}
ret = intel_fill_fb_info(dev_priv, intel_fb);
@@ -2163,23 +2183,32 @@ intel_user_framebuffer_create(struct drm_device *dev,
struct drm_framebuffer *fb;
struct drm_i915_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
- struct drm_i915_private *i915;
+ struct drm_i915_private *i915 = to_i915(dev);
+ struct drm_gem_object *gem = drm_gem_object_lookup(filp, mode_cmd.handles[0]);
- obj = i915_gem_object_lookup(filp, mode_cmd.handles[0]);
- if (!obj)
+ if (!gem)
return ERR_PTR(-ENOENT);
+ obj = to_intel_bo(gem);
+#ifdef I915
/* object is backed with LMEM for discrete */
- i915 = to_i915(obj->base.dev);
if (HAS_LMEM(i915) && !i915_gem_object_can_migrate(obj, INTEL_REGION_LMEM_0)) {
/* object is "remote", not in local memory */
i915_gem_object_put(obj);
drm_dbg_kms(&i915->drm, "framebuffer must reside in local memory\n");
return ERR_PTR(-EREMOTE);
}
+#else
+ /* Require vram placement or dma-buf import */
+ if (XE_IOCTL_DBG(i915, IS_DGFX(i915) && !xe_bo_can_migrate(obj, XE_PL_VRAM0) &&
+ obj->ttm.type != ttm_bo_type_sg)) {
+ drm_gem_object_put(gem);
+ return ERR_PTR(-EREMOTE);
+ }
+#endif
fb = intel_framebuffer_create(obj, &mode_cmd);
- i915_gem_object_put(obj);
+ drm_gem_object_put(gem);
return fb;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile.
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (8 preceding siblings ...)
2023-11-09 15:07 ` [Intel-xe] [PATCH 9/9] FIXME drm/i915/display: Make intel_fb.c code compatible with xe Maarten Lankhorst
@ 2023-11-09 15:14 ` Patchwork
2023-11-15 23:31 ` [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile. (rev2) Patchwork
2023-11-17 21:37 ` Patchwork
11 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2023-11-09 15:14 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-xe
== Series Details ==
Series: Break up remaining changes to make xe compile.
URL : https://patchwork.freedesktop.org/series/126200/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-xe-next' with base: ===
Base commit: 2096aea11 fixup! drm/xe/gsc: add gsc device support
=== git am output follows ===
.git/rebase-apply/patch:20: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: drm/i915: Use drm_atomic_helper_wait_for_fences helper.
Applying: fixup! drm/xe/display: Implement display support
Applying: drm/i915/display: Revert all before remaining changes to make xe compile
Applying: drm/i915/display: Revert remaining changes to make xe compile
Applying: drm/xe: Update headers to be more compatible with i915
Applying: FIXME drm/i915/display: add_dma_resv_fences is i915 only
Applying: drm/i915/display: Use i915_gem_object_get_dma_address to get dma address
Applying: FIXME drm/i915/display: Minimal changes to fbdev to make xe work
Applying: FIXME drm/i915/display: Make intel_fb.c code compatible with xe
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Intel-xe] [1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper.
2023-11-09 15:07 ` [Intel-xe] [PATCH 1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper Maarten Lankhorst
@ 2023-11-10 11:33 ` Hogander, Jouni
0 siblings, 0 replies; 17+ messages in thread
From: Hogander, Jouni @ 2023-11-10 11:33 UTC (permalink / raw)
To: intel-xe@lists.freedesktop.org, maarten.lankhorst@linux.intel.com
Cc: dev@lankhorst.se
On Thu, 2023-11-09 at 16:07 +0100, Maarten Lankhorst wrote:
> From: Maarten Lankhorst <dev@lankhorst.se>
>
> The fence api specifies you should wait for fence to completion, not
> give up after whatever timeout was originally configured. The fences
> themselves should prevent the timeout from being indefinite.
>
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
This is not blocking anything in drm-xe-next and not really related to
this patch set either. I think we can just fine go through the review
and ci testing in intel-gfx mailing list and backport from there/or get
it via rebase.
BR,
Jouni Högander
> ---
> .../gpu/drm/i915/display/intel_atomic_plane.c | 1 -
> drivers/gpu/drm/i915/display/intel_display.c | 23 +----------------
> --
> 2 files changed, 1 insertion(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index 77e281bf4cb5f..14eeb42c9e2a3 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -38,7 +38,6 @@
> #include <drm/drm_blend.h>
> #include <drm/drm_fourcc.h>
>
> -#include "i915_config.h"
> #include "i915_reg.h"
> #include "intel_atomic_plane.h"
> #include "intel_cdclk.h"
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index b27b533f03d6e..82ff5309a0629 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -50,7 +50,6 @@
> #include "g4x_dp.h"
> #include "g4x_hdmi.h"
> #include "hsw_ips.h"
> -#include "i915_config.h"
> #include "i915_drv.h"
> #include "i915_reg.h"
> #include "i915_utils.h"
> @@ -7055,26 +7054,6 @@ void
> intel_atomic_helper_free_state_worker(struct work_struct *work)
> intel_atomic_helper_free_state(dev_priv);
> }
>
> -static void intel_atomic_commit_fence_wait(struct intel_atomic_state
> *intel_state)
> -{
> - struct drm_i915_private *i915 = to_i915(intel_state-
> >base.dev);
> - struct drm_plane *plane;
> - struct drm_plane_state *new_plane_state;
> - int ret, i;
> -
> - for_each_new_plane_in_state(&intel_state->base, plane,
> new_plane_state, i) {
> - if (new_plane_state->fence) {
> - ret = dma_fence_wait_timeout(new_plane_state-
> >fence, false,
> -
> i915_fence_timeout(i915));
> - if (ret <= 0)
> - break;
> -
> - dma_fence_put(new_plane_state->fence);
> - new_plane_state->fence = NULL;
> - }
> - }
> -}
> -
> static void intel_atomic_cleanup_work(struct work_struct *work)
> {
> struct intel_atomic_state *state =
> @@ -7180,7 +7159,7 @@ static void intel_atomic_commit_tail(struct
> intel_atomic_state *state)
> intel_wakeref_t wakeref = 0;
> int i;
>
> - intel_atomic_commit_fence_wait(state);
> + drm_atomic_helper_wait_for_fences(dev, &state->base, false);
>
> drm_atomic_helper_wait_for_dependencies(&state->base);
> drm_dp_mst_atomic_wait_for_dependencies(&state->base);
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Intel-xe] [3/9] drm/i915/display: Revert all before remaining changes to make xe compile
2023-11-09 15:07 ` [Intel-xe] [PATCH 3/9] drm/i915/display: Revert all before remaining changes to make xe compile Maarten Lankhorst
@ 2023-11-10 11:41 ` Hogander, Jouni
0 siblings, 0 replies; 17+ messages in thread
From: Hogander, Jouni @ 2023-11-10 11:41 UTC (permalink / raw)
To: intel-xe@lists.freedesktop.org, maarten.lankhorst@linux.intel.com
Cc: dev@lankhorst.se
On Thu, 2023-11-09 at 16:07 +0100, Maarten Lankhorst wrote:
> From: Maarten Lankhorst <dev@lankhorst.se>
>
> drm/xe/display: Allow scanout of bos that can be migrated to lmem
> drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base
>
> Can probably be slightly ignored by squashing with next patch, at
> least
> for intel_bo_to_drm_bo part.
I don't understand what this patch is about. I think you should improve
commit message. Commit message is mentioning revert but it is not clear
what are the commits that are reverted?
BR,
Jouni Högander
>
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
> ---
> drivers/gpu/drm/i915/display/intel_fb.c | 9 ++--
> drivers/gpu/drm/i915/display/intel_fbdev.c | 48 ++++++++------------
> --
> 2 files changed, 22 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c
> b/drivers/gpu/drm/i915/display/intel_fb.c
> index 1ce61245728a7..bf275b2692b8f 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -1964,10 +1964,10 @@ static int
> intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
> if (!atomic_read(&front->bits))
> return 0;
>
> - if (dma_resv_test_signaled(intel_bo_to_drm_bo(obj)->resv,
> dma_resv_usage_rw(false)))
> + if (dma_resv_test_signaled(obj->base.resv,
> dma_resv_usage_rw(false)))
> goto flush;
>
> - ret = dma_resv_get_singleton(intel_bo_to_drm_bo(obj)->resv,
> dma_resv_usage_rw(false),
> + ret = dma_resv_get_singleton(obj->base.resv,
> dma_resv_usage_rw(false),
> &fence);
> if (ret || !fence)
> goto flush;
> @@ -2227,9 +2227,8 @@ intel_user_framebuffer_create(struct drm_device
> *dev,
> return ERR_PTR(-ENOENT);
>
> obj = gem_to_xe_bo(gem);
> - /* Require vram placement or dma-buf import */
> - if (IS_DGFX(i915) &&
> - !xe_bo_can_migrate(gem_to_xe_bo(gem), XE_PL_VRAM0) &&
> + /* Require vram exclusive objects, but allow dma-buf imports
> */
> + if (IS_DGFX(i915) && obj->flags & XE_BO_CREATE_SYSTEM_BIT &&
> obj->ttm.type != ttm_bo_type_sg) {
> drm_gem_object_put(gem);
> return ERR_PTR(-EREMOTE);
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c
> b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index b7976706bc681..28b9aa9d52c26 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -48,7 +48,6 @@
> #include "gem/i915_gem_mman.h"
> #else
> #include "xe_gt.h"
> -#include "xe_ttm_stolen_mgr.h"
> #endif
>
> #include "i915_drv.h"
> @@ -193,8 +192,8 @@ static int intelfb_alloc(struct drm_fb_helper
> *helper,
>
> size = mode_cmd.pitches[0] * mode_cmd.height;
> size = PAGE_ALIGN(size);
> - obj = ERR_PTR(-ENODEV);
> #ifdef I915
> + obj = ERR_PTR(-ENODEV);
> if (HAS_LMEM(dev_priv)) {
> obj = i915_gem_object_create_lmem(dev_priv, size,
>
> I915_BO_ALLOC_CONTIGUOUS |
> @@ -213,23 +212,11 @@ static int intelfb_alloc(struct drm_fb_helper
> *helper,
> obj = i915_gem_object_create_shmem(dev_priv,
> size);
> }
> #else
> - if (!IS_DGFX(dev_priv)) {
> - obj = xe_bo_create_pin_map(dev_priv,
> xe_device_get_root_tile(dev_priv),
> - NULL, size,
> - ttm_bo_type_kernel,
> XE_BO_SCANOUT_BIT |
> - XE_BO_CREATE_STOLEN_BIT |
> - XE_BO_CREATE_PINNED_BIT);
> - if (!IS_ERR(obj))
> - drm_info(&dev_priv->drm, "Allocated fbdev
> into stolen\n");
> - else
> - drm_info(&dev_priv->drm, "Allocated fbdev
> into stolen failed: %li\n", PTR_ERR(obj));
> - }
> - if (IS_ERR(obj)) {
> - obj = xe_bo_create_pin_map(dev_priv,
> xe_device_get_root_tile(dev_priv), NULL, size,
> - ttm_bo_type_kernel,
> XE_BO_SCANOUT_BIT |
> -
> XE_BO_CREATE_VRAM_IF_DGFX(xe_device_get_root_tile(dev_priv)) |
> - XE_BO_CREATE_PINNED_BIT);
> - }
> + /* XXX: Care about stolen? */
> + obj = xe_bo_create_pin_map(dev_priv, to_gt(dev_priv), NULL,
> size,
> + ttm_bo_type_kernel,
> +
> XE_BO_CREATE_VRAM_IF_DGFX(to_gt(dev_priv)) |
> + XE_BO_CREATE_PINNED_BIT |
> XE_BO_SCANOUT_BIT);
> #endif
>
> if (IS_ERR(obj)) {
> @@ -365,23 +352,24 @@ static int intelfb_create(struct drm_fb_helper
> *helper,
> }
>
> #else
> - if (!(obj->flags & XE_BO_CREATE_SYSTEM_BIT)) {
> - if (obj->flags & XE_BO_CREATE_STOLEN_BIT)
> - info->fix.smem_start =
> xe_ttm_stolen_io_offset(obj, 0);
> - else
> - info->fix.smem_start =
> - pci_resource_start(pdev, 2) +
> - xe_bo_addr(obj, 0, XE_PAGE_SIZE);
> + /* XXX: Could be pure fiction.. */
> + if (obj->flags & XE_BO_CREATE_VRAM0_BIT) {
> + struct xe_gt *gt = to_gt(dev_priv);
> + bool lmem;
>
> + info->fix.smem_start =
> + (unsigned long)(gt->mem.vram.io_start +
> xe_bo_addr(obj, 0, 4096, &lmem));
> info->fix.smem_len = obj->ttm.base.size;
> +
> } else {
> - /* XXX: Pure fiction, as the BO may not be physically
> accessible.. */
> - info->fix.smem_start = 0;
> + struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
> +
> + info->fix.smem_start = pci_resource_start(pdev, 2) +
> xe_bo_ggtt_addr(obj);
> info->fix.smem_len = obj->ttm.base.size;
> }
>
> - XE_WARN_ON(iosys_map_is_null(&obj->vmap));
> - vaddr = obj->vmap.vaddr_iomem;
> + /* TODO: ttm_bo_kmap? */
> + vaddr = obj->vmap.vaddr;
> #endif
> if (IS_ERR(vaddr)) {
> drm_err(&dev_priv->drm,
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Intel-xe] [6/9] FIXME drm/i915/display: add_dma_resv_fences is i915 only
2023-11-09 15:07 ` [Intel-xe] [PATCH 6/9] FIXME drm/i915/display: add_dma_resv_fences is i915 only Maarten Lankhorst
@ 2023-11-10 11:56 ` Hogander, Jouni
0 siblings, 0 replies; 17+ messages in thread
From: Hogander, Jouni @ 2023-11-10 11:56 UTC (permalink / raw)
To: intel-xe@lists.freedesktop.org, maarten.lankhorst@linux.intel.com
Cc: dev@lankhorst.se
On Thu, 2023-11-09 at 16:07 +0100, Maarten Lankhorst wrote:
> From: Maarten Lankhorst <dev@lankhorst.se>
>
> I'm 99% sure that this code is no longer needed on i915, but I'm 100%
> sure it won't be needed for xe.
And it does nothing for Xe -> ifdefs added by this patch are just
optimization to not build this part for Xe.
This isn't blocking any Xe work so if you think this isn't needed for
i915 I think you should send the patch to
intel-gfx@lists.freedesktop.org. Do the review and CI testing there and
then backport.
BR,
Jouni Högander
>
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
> ---
> drivers/gpu/drm/i915/display/intel_atomic_plane.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index ef553270c0796..a5ee4af25836f 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -1021,9 +1021,10 @@ int intel_plane_check_src_coordinates(struct
> intel_plane_state *plane_state)
> static int add_dma_resv_fences(struct dma_resv *resv,
> struct drm_plane_state
> *new_plane_state)
> {
> + int ret = 0;
> +#ifdef I915
> struct dma_fence *fence = dma_fence_get(new_plane_state-
> >fence);
> struct dma_fence *new;
> - int ret;
>
> ret = dma_resv_get_singleton(resv, dma_resv_usage_rw(false),
> &new);
> if (ret)
> @@ -1050,6 +1051,7 @@ static int add_dma_resv_fences(struct dma_resv
> *resv,
>
> error:
> dma_fence_put(fence);
> +#endif
> return ret;
> }
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Intel-xe] [7/9] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address
2023-11-09 15:07 ` [Intel-xe] [PATCH 7/9] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address Maarten Lankhorst
@ 2023-11-10 12:02 ` Hogander, Jouni
0 siblings, 0 replies; 17+ messages in thread
From: Hogander, Jouni @ 2023-11-10 12:02 UTC (permalink / raw)
To: intel-xe@lists.freedesktop.org, maarten.lankhorst@linux.intel.com
On Thu, 2023-11-09 at 16:07 +0100, Maarten Lankhorst wrote:
> Works better for xe like that. obj is no longer const.
This should be sent to intel-gfx@lists.freedesktop.org.
BR,
Jouni Högander
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cursor.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c
> b/drivers/gpu/drm/i915/display/intel_cursor.c
> index b342fad180ca5..0d21c34f74990 100644
> --- a/drivers/gpu/drm/i915/display/intel_cursor.c
> +++ b/drivers/gpu/drm/i915/display/intel_cursor.c
> @@ -23,6 +23,8 @@
> #include "intel_psr.h"
> #include "skl_watermark.h"
>
> +#include "gem/i915_gem_object.h"
> +
> /* Cursor formats */
> static const u32 intel_cursor_formats[] = {
> DRM_FORMAT_ARGB8888,
> @@ -33,11 +35,11 @@ static u32 intel_cursor_base(const struct
> intel_plane_state *plane_state)
> struct drm_i915_private *dev_priv =
> to_i915(plane_state->uapi.plane->dev);
> const struct drm_framebuffer *fb = plane_state->hw.fb;
> - const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> + struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> u32 base;
>
> if (DISPLAY_INFO(dev_priv)->cursor_needs_physical)
> - base = sg_dma_address(obj->mm.pages->sgl);
> + base = i915_gem_object_get_dma_address(obj, 0);
> else
> base = intel_plane_ggtt_offset(plane_state);
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile. (rev2)
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (9 preceding siblings ...)
2023-11-09 15:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile Patchwork
@ 2023-11-15 23:31 ` Patchwork
2023-11-17 21:37 ` Patchwork
11 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2023-11-15 23:31 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-xe
== Series Details ==
Series: Break up remaining changes to make xe compile. (rev2)
URL : https://patchwork.freedesktop.org/series/126200/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-xe-next' with base: ===
Base commit: eba8bfb1d fixup! drm/xe/display: Implement display support
=== git am output follows ===
error: patch failed: drivers/gpu/drm/i915/display/intel_fbdev.c:48
error: drivers/gpu/drm/i915/display/intel_fbdev.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/i915: Use drm_atomic_helper_wait_for_fences helper.
Applying: fixup! drm/xe/display: Implement display support
Applying: drm/i915/display: Revert all before remaining changes to make xe compile
Patch failed at 0003 drm/i915/display: Revert all before remaining changes to make xe compile
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile. (rev2)
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
` (10 preceding siblings ...)
2023-11-15 23:31 ` [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile. (rev2) Patchwork
@ 2023-11-17 21:37 ` Patchwork
11 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2023-11-17 21:37 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-xe
== Series Details ==
Series: Break up remaining changes to make xe compile. (rev2)
URL : https://patchwork.freedesktop.org/series/126200/
State : failure
== Summary ==
=== Applying kernel patches on branch 'drm-xe-next' with base: ===
Base commit: 3b8183b7e drm/xe/uapi: Be more specific about the vm_bind prefetch region
=== git am output follows ===
error: patch failed: drivers/gpu/drm/i915/display/intel_fbdev.c:48
error: drivers/gpu/drm/i915/display/intel_fbdev.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/i915: Use drm_atomic_helper_wait_for_fences helper.
Applying: fixup! drm/xe/display: Implement display support
Applying: drm/i915/display: Revert all before remaining changes to make xe compile
Patch failed at 0003 drm/i915/display: Revert all before remaining changes to make xe compile
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2023-11-17 21:37 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 15:07 [Intel-xe] [PATCH 0/9] Break up remaining changes to make xe compile Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 1/9] drm/i915: Use drm_atomic_helper_wait_for_fences helper Maarten Lankhorst
2023-11-10 11:33 ` [Intel-xe] [1/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 2/9] fixup! drm/xe/display: Implement display support Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 3/9] drm/i915/display: Revert all before remaining changes to make xe compile Maarten Lankhorst
2023-11-10 11:41 ` [Intel-xe] [3/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 4/9] drm/i915/display: Revert " Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 5/9] drm/xe: Update headers to be more compatible with i915 Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 6/9] FIXME drm/i915/display: add_dma_resv_fences is i915 only Maarten Lankhorst
2023-11-10 11:56 ` [Intel-xe] [6/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 7/9] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address Maarten Lankhorst
2023-11-10 12:02 ` [Intel-xe] [7/9] " Hogander, Jouni
2023-11-09 15:07 ` [Intel-xe] [PATCH 8/9] FIXME drm/i915/display: Minimal changes to fbdev to make xe work Maarten Lankhorst
2023-11-09 15:07 ` [Intel-xe] [PATCH 9/9] FIXME drm/i915/display: Make intel_fb.c code compatible with xe Maarten Lankhorst
2023-11-09 15:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile Patchwork
2023-11-15 23:31 ` [Intel-xe] ✗ CI.Patch_applied: failure for Break up remaining changes to make xe compile. (rev2) Patchwork
2023-11-17 21:37 ` Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.