Commit 8e712bd7 authored by Jani Nikula's avatar Jani Nikula

drm/xe/display: drop i915_drv.h include from xe code

Drop i915_drv.h include from xe display code as much as possible, and
switch to xe types where necessary.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/bb490f3e928fd8178277fde2435de80638fc5715.1717004739.git.jani.nikula@intel.com
parent 3ddb4f80
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* Copyright © 2023 Intel Corporation * Copyright © 2023 Intel Corporation
*/ */
#include "i915_drv.h"
#include "i915_irq.h" #include "i915_irq.h"
#include "i915_reg.h" #include "i915_reg.h"
#include "intel_uncore.h" #include "intel_uncore.h"
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <drm/drm_modeset_helper.h> #include <drm/drm_modeset_helper.h>
#include <drm/ttm/ttm_bo.h> #include <drm/ttm/ttm_bo.h>
#include "i915_drv.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_fb_bo.h" #include "intel_fb_bo.h"
#include "xe_bo.h" #include "xe_bo.h"
...@@ -26,7 +25,7 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb, ...@@ -26,7 +25,7 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
struct xe_bo *bo, struct xe_bo *bo,
struct drm_mode_fb_cmd2 *mode_cmd) struct drm_mode_fb_cmd2 *mode_cmd)
{ {
struct drm_i915_private *i915 = to_i915(bo->ttm.base.dev); struct xe_device *xe = to_xe_device(bo->ttm.base.dev);
int ret; int ret;
xe_bo_get(bo); xe_bo_get(bo);
...@@ -42,7 +41,7 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb, ...@@ -42,7 +41,7 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
* mode when the boect is VM_BINDed, so we can only set * mode when the boect is VM_BINDed, so we can only set
* coherency with display when unbound. * coherency with display when unbound.
*/ */
if (XE_IOCTL_DBG(i915, !list_empty(&bo->ttm.base.gpuva.list))) { if (XE_IOCTL_DBG(xe, !list_empty(&bo->ttm.base.gpuva.list))) {
ttm_bo_unreserve(&bo->ttm); ttm_bo_unreserve(&bo->ttm);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <drm/drm_fb_helper.h> #include <drm/drm_fb_helper.h>
#include "i915_drv.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_fbdev_fb.h" #include "intel_fbdev_fb.h"
#include "xe_bo.h" #include "xe_bo.h"
...@@ -17,7 +16,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, ...@@ -17,7 +16,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
{ {
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
struct drm_device *dev = helper->dev; struct drm_device *dev = helper->dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct xe_device *xe = to_xe_device(dev);
struct drm_mode_fb_cmd2 mode_cmd = {}; struct drm_mode_fb_cmd2 mode_cmd = {};
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
int size; int size;
...@@ -38,26 +37,26 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, ...@@ -38,26 +37,26 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
size = PAGE_ALIGN(size); size = PAGE_ALIGN(size);
obj = ERR_PTR(-ENODEV); obj = ERR_PTR(-ENODEV);
if (!IS_DGFX(dev_priv)) { if (!IS_DGFX(xe)) {
obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv), obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe),
NULL, size, NULL, size,
ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT | ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
XE_BO_FLAG_STOLEN | XE_BO_FLAG_STOLEN |
XE_BO_FLAG_PINNED); XE_BO_FLAG_PINNED);
if (!IS_ERR(obj)) if (!IS_ERR(obj))
drm_info(&dev_priv->drm, "Allocated fbdev into stolen\n"); drm_info(&xe->drm, "Allocated fbdev into stolen\n");
else else
drm_info(&dev_priv->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj)); drm_info(&xe->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj));
} }
if (IS_ERR(obj)) { if (IS_ERR(obj)) {
obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv), NULL, size, obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), NULL, size,
ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT | ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(dev_priv)) | XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(xe)) |
XE_BO_FLAG_PINNED); XE_BO_FLAG_PINNED);
} }
if (IS_ERR(obj)) { if (IS_ERR(obj)) {
drm_err(&dev_priv->drm, "failed to allocate framebuffer (%pe)\n", obj); drm_err(&xe->drm, "failed to allocate framebuffer (%pe)\n", obj);
fb = ERR_PTR(-ENOMEM); fb = ERR_PTR(-ENOMEM);
goto err; goto err;
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* Copyright 2023, Intel Corporation. * Copyright 2023, Intel Corporation.
*/ */
#include "i915_drv.h"
#include "i915_vma.h" #include "i915_vma.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dsb_buffer.h" #include "intel_dsb_buffer.h"
...@@ -34,18 +33,18 @@ void intel_dsb_buffer_memset(struct intel_dsb_buffer *dsb_buf, u32 idx, u32 val, ...@@ -34,18 +33,18 @@ void intel_dsb_buffer_memset(struct intel_dsb_buffer *dsb_buf, u32 idx, u32 val,
bool intel_dsb_buffer_create(struct intel_crtc *crtc, struct intel_dsb_buffer *dsb_buf, size_t size) bool intel_dsb_buffer_create(struct intel_crtc *crtc, struct intel_dsb_buffer *dsb_buf, size_t size)
{ {
struct drm_i915_private *i915 = to_i915(crtc->base.dev); struct xe_device *xe = to_xe_device(crtc->base.dev);
struct drm_i915_gem_object *obj; struct xe_bo *obj;
struct i915_vma *vma; struct i915_vma *vma;
vma = kzalloc(sizeof(*vma), GFP_KERNEL); vma = kzalloc(sizeof(*vma), GFP_KERNEL);
if (!vma) if (!vma)
return false; return false;
obj = xe_bo_create_pin_map(i915, xe_device_get_root_tile(i915), obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe),
NULL, PAGE_ALIGN(size), NULL, PAGE_ALIGN(size),
ttm_bo_type_kernel, ttm_bo_type_kernel,
XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(i915)) | XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(xe)) |
XE_BO_FLAG_GGTT); XE_BO_FLAG_GGTT);
if (IS_ERR(obj)) { if (IS_ERR(obj)) {
kfree(vma); kfree(vma);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <drm/ttm/ttm_bo.h> #include <drm/ttm/ttm_bo.h>
#include "i915_drv.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dpt.h" #include "intel_dpt.h"
#include "intel_fb.h" #include "intel_fb.h"
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "regs/xe_gtt_defs.h" #include "regs/xe_gtt_defs.h"
#include "xe_ggtt.h" #include "xe_ggtt.h"
#include "i915_drv.h"
#include "intel_atomic_plane.h" #include "intel_atomic_plane.h"
#include "intel_crtc.h" #include "intel_crtc.h"
#include "intel_display.h" #include "intel_display.h"
...@@ -25,10 +24,10 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this, ...@@ -25,10 +24,10 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this,
const struct intel_initial_plane_config plane_configs[], const struct intel_initial_plane_config plane_configs[],
struct drm_framebuffer **fb) struct drm_framebuffer **fb)
{ {
struct drm_i915_private *i915 = to_i915(this->base.dev); struct xe_device *xe = to_xe_device(this->base.dev);
struct intel_crtc *crtc; struct intel_crtc *crtc;
for_each_intel_crtc(&i915->drm, crtc) { for_each_intel_crtc(&xe->drm, crtc) {
struct intel_plane *plane = struct intel_plane *plane =
to_intel_plane(crtc->base.primary); to_intel_plane(crtc->base.primary);
const struct intel_plane_state *plane_state = const struct intel_plane_state *plane_state =
...@@ -135,8 +134,7 @@ static bool ...@@ -135,8 +134,7 @@ static bool
intel_alloc_initial_plane_obj(struct intel_crtc *crtc, intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
struct intel_initial_plane_config *plane_config) struct intel_initial_plane_config *plane_config)
{ {
struct drm_device *dev = crtc->base.dev; struct xe_device *xe = to_xe_device(crtc->base.dev);
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_mode_fb_cmd2 mode_cmd = { 0 }; struct drm_mode_fb_cmd2 mode_cmd = { 0 };
struct drm_framebuffer *fb = &plane_config->fb->base; struct drm_framebuffer *fb = &plane_config->fb->base;
struct xe_bo *bo; struct xe_bo *bo;
...@@ -148,7 +146,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc, ...@@ -148,7 +146,7 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
case I915_FORMAT_MOD_4_TILED: case I915_FORMAT_MOD_4_TILED:
break; break;
default: default:
drm_dbg(&dev_priv->drm, drm_dbg_kms(&xe->drm,
"Unsupported modifier for initial FB: 0x%llx\n", "Unsupported modifier for initial FB: 0x%llx\n",
fb->modifier); fb->modifier);
return false; return false;
...@@ -161,13 +159,13 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc, ...@@ -161,13 +159,13 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
mode_cmd.modifier[0] = fb->modifier; mode_cmd.modifier[0] = fb->modifier;
mode_cmd.flags = DRM_MODE_FB_MODIFIERS; mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
bo = initial_plane_bo(dev_priv, plane_config); bo = initial_plane_bo(xe, plane_config);
if (!bo) if (!bo)
return false; return false;
if (intel_framebuffer_init(to_intel_framebuffer(fb), if (intel_framebuffer_init(to_intel_framebuffer(fb),
bo, &mode_cmd)) { bo, &mode_cmd)) {
drm_dbg_kms(&dev_priv->drm, "intel fb init failed\n"); drm_dbg_kms(&xe->drm, "intel fb init failed\n");
goto err_bo; goto err_bo;
} }
/* Reference handed over to fb */ /* Reference handed over to fb */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment