From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>, <lucas.demarchi@intel.com>
Subject: Re: [PATCH 10/10] drm/xe/display: drop i915_drv.h include from xe code
Date: Fri, 31 May 2024 08:10:30 -0400 [thread overview]
Message-ID: <Zlm-Np52-ayoO3-W@intel.com> (raw)
In-Reply-To: <bb490f3e928fd8178277fde2435de80638fc5715.1717004739.git.jani.nikula@intel.com>
On Wed, May 29, 2024 at 08:48:14PM +0300, Jani Nikula wrote:
> Drop i915_drv.h include from xe display code as much as possible, and
> switch to xe types where necessary.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/xe/display/ext/i915_irq.c | 1 -
> drivers/gpu/drm/xe/display/intel_fb_bo.c | 5 ++---
> drivers/gpu/drm/xe/display/intel_fbdev_fb.c | 17 ++++++++---------
> drivers/gpu/drm/xe/display/xe_dsb_buffer.c | 9 ++++-----
> drivers/gpu/drm/xe/display/xe_fb_pin.c | 1 -
> drivers/gpu/drm/xe/display/xe_plane_initial.c | 18 ++++++++----------
> 6 files changed, 22 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/display/ext/i915_irq.c b/drivers/gpu/drm/xe/display/ext/i915_irq.c
> index bee191a4a97d..eb40f1cb44f6 100644
> --- a/drivers/gpu/drm/xe/display/ext/i915_irq.c
> +++ b/drivers/gpu/drm/xe/display/ext/i915_irq.c
> @@ -3,7 +3,6 @@
> * Copyright © 2023 Intel Corporation
> */
>
> -#include "i915_drv.h"
> #include "i915_irq.h"
> #include "i915_reg.h"
> #include "intel_uncore.h"
> diff --git a/drivers/gpu/drm/xe/display/intel_fb_bo.c b/drivers/gpu/drm/xe/display/intel_fb_bo.c
> index b89cda053d2c..f835492f73fb 100644
> --- a/drivers/gpu/drm/xe/display/intel_fb_bo.c
> +++ b/drivers/gpu/drm/xe/display/intel_fb_bo.c
> @@ -6,7 +6,6 @@
> #include <drm/drm_modeset_helper.h>
> #include <drm/ttm/ttm_bo.h>
>
> -#include "i915_drv.h"
> #include "intel_display_types.h"
> #include "intel_fb_bo.h"
> #include "xe_bo.h"
> @@ -26,7 +25,7 @@ int intel_fb_bo_framebuffer_init(struct intel_framebuffer *intel_fb,
> struct xe_bo *bo,
> 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;
>
> xe_bo_get(bo);
> @@ -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
> * 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);
> ret = -EINVAL;
> goto err;
> diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> index 5ecc7d467934..3a2f3a5ac2f9 100644
> --- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> +++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> @@ -5,7 +5,6 @@
>
> #include <drm/drm_fb_helper.h>
>
> -#include "i915_drv.h"
> #include "intel_display_types.h"
> #include "intel_fbdev_fb.h"
> #include "xe_bo.h"
> @@ -17,7 +16,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
> {
> struct drm_framebuffer *fb;
> 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_i915_gem_object *obj;
> int size;
> @@ -38,26 +37,26 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
> size = PAGE_ALIGN(size);
> obj = ERR_PTR(-ENODEV);
>
> - if (!IS_DGFX(dev_priv)) {
> - obj = xe_bo_create_pin_map(dev_priv, xe_device_get_root_tile(dev_priv),
> + if (!IS_DGFX(xe)) {
> + obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe),
> NULL, size,
> ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
> XE_BO_FLAG_STOLEN |
> XE_BO_FLAG_PINNED);
> if (!IS_ERR(obj))
> - drm_info(&dev_priv->drm, "Allocated fbdev into stolen\n");
> + drm_info(&xe->drm, "Allocated fbdev into stolen\n");
> 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)) {
> - 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 |
> - 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);
> }
>
> 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);
> goto err;
> }
> diff --git a/drivers/gpu/drm/xe/display/xe_dsb_buffer.c b/drivers/gpu/drm/xe/display/xe_dsb_buffer.c
> index 44c9fd2143cc..9e860c61f4b3 100644
> --- a/drivers/gpu/drm/xe/display/xe_dsb_buffer.c
> +++ b/drivers/gpu/drm/xe/display/xe_dsb_buffer.c
> @@ -3,7 +3,6 @@
> * Copyright 2023, Intel Corporation.
> */
>
> -#include "i915_drv.h"
> #include "i915_vma.h"
> #include "intel_display_types.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,
>
> 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 drm_i915_gem_object *obj;
> + struct xe_device *xe = to_xe_device(crtc->base.dev);
> + struct xe_bo *obj;
> struct i915_vma *vma;
>
> vma = kzalloc(sizeof(*vma), GFP_KERNEL);
> if (!vma)
> 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),
> 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);
> if (IS_ERR(obj)) {
> kfree(vma);
> diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c
> index 0449cdb892f3..a2f417209124 100644
> --- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
> +++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
> @@ -5,7 +5,6 @@
>
> #include <drm/ttm/ttm_bo.h>
>
> -#include "i915_drv.h"
> #include "intel_display_types.h"
> #include "intel_dpt.h"
> #include "intel_fb.h"
> diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c
> index 7672a0cffbd8..e135b20962d9 100644
> --- a/drivers/gpu/drm/xe/display/xe_plane_initial.c
> +++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c
> @@ -9,7 +9,6 @@
> #include "regs/xe_gtt_defs.h"
> #include "xe_ggtt.h"
>
> -#include "i915_drv.h"
> #include "intel_atomic_plane.h"
> #include "intel_crtc.h"
> #include "intel_display.h"
> @@ -25,10 +24,10 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this,
> const struct intel_initial_plane_config plane_configs[],
> 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;
>
> - for_each_intel_crtc(&i915->drm, crtc) {
> + for_each_intel_crtc(&xe->drm, crtc) {
> struct intel_plane *plane =
> to_intel_plane(crtc->base.primary);
> const struct intel_plane_state *plane_state =
> @@ -135,8 +134,7 @@ static bool
> intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> struct intel_initial_plane_config *plane_config)
> {
> - struct drm_device *dev = crtc->base.dev;
> - struct drm_i915_private *dev_priv = to_i915(dev);
> + struct xe_device *xe = to_xe_device(crtc->base.dev);
> struct drm_mode_fb_cmd2 mode_cmd = { 0 };
> struct drm_framebuffer *fb = &plane_config->fb->base;
> struct xe_bo *bo;
> @@ -148,9 +146,9 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> case I915_FORMAT_MOD_4_TILED:
> break;
> default:
> - drm_dbg(&dev_priv->drm,
> - "Unsupported modifier for initial FB: 0x%llx\n",
> - fb->modifier);
> + drm_dbg_kms(&xe->drm,
> + "Unsupported modifier for initial FB: 0x%llx\n",
> + fb->modifier);
> return false;
> }
>
> @@ -161,13 +159,13 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> mode_cmd.modifier[0] = fb->modifier;
> mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
>
> - bo = initial_plane_bo(dev_priv, plane_config);
> + bo = initial_plane_bo(xe, plane_config);
> if (!bo)
> return false;
>
> if (intel_framebuffer_init(to_intel_framebuffer(fb),
> 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;
> }
> /* Reference handed over to fb */
> --
> 2.39.2
>
next prev parent reply other threads:[~2024-05-31 12:10 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 17:48 [PATCH 00/10] drm/i915 and drm/xe display and compat cleanups Jani Nikula
2024-05-29 17:48 ` [PATCH 01/10] drm/i915/display: include gem/i915_gem_stolen.h where needed Jani Nikula
2024-05-31 11:03 ` Rodrigo Vivi
2024-05-31 12:03 ` Jani Nikula
2024-06-04 11:41 ` Jani Nikula
2024-06-04 20:34 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 02/10] drm/i915/display: include gt/intel_gt_types.h " Jani Nikula
2024-05-31 11:05 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 03/10] drm/i915/display: include i915_gpu_error.h " Jani Nikula
2024-05-31 11:07 ` Rodrigo Vivi
2024-05-31 11:35 ` Ville Syrjälä
2024-05-31 12:07 ` Jani Nikula
2024-05-31 12:17 ` Jani Nikula
2024-05-29 17:48 ` [PATCH 04/10] drm/i915/display: include intel_uncore.h " Jani Nikula
2024-05-31 11:07 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 05/10] drm/i915/display: include intel_step.h " Jani Nikula
2024-05-31 12:03 ` Rodrigo Vivi
2024-05-31 12:08 ` Jani Nikula
2024-05-29 17:48 ` [PATCH 06/10] drm/i915/display: include xe_bo.h, gem_object_types etc. " Jani Nikula
2024-05-31 12:07 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 07/10] drm/xe/display: move compat uncore stubs to the correct file Jani Nikula
2024-05-31 12:08 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 08/10] drm/xe/display: move compat runtime pm " Jani Nikula
2024-05-31 12:09 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 09/10] drm/xe/display: reduce includes in compat i915_drv.h Jani Nikula
2024-05-31 12:09 ` Rodrigo Vivi
2024-05-29 17:48 ` [PATCH 10/10] drm/xe/display: drop i915_drv.h include from xe code Jani Nikula
2024-05-31 12:10 ` Rodrigo Vivi [this message]
2024-05-29 18:48 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915 and drm/xe display and compat cleanups Patchwork
2024-05-29 18:48 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-05-29 18:56 ` ✓ Fi.CI.BAT: success " Patchwork
2024-05-30 19:38 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zlm-Np52-ayoO3-W@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=lucas.demarchi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox