Commit cb0f3a17 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/xe/compat: remove i915_vma.h from compat



Move compat i915_vma.h to xe_display_vma.h, and remove all extra
cruft. Drop the i915_ggtt_offset() wrapper in favour of using
xe_ggtt_node_addr() directly.

The usefulness of the I915_TILING_X and I915_TILING_Y undef/define is
unclear, since uapi/drm/i915_drm.h is included in other paths as well.

The naming of struct i915_vma is a bit unfortunate in xe, but (at least
for now) a necessity for maintaining type safety on the opaque type.

Reviewed-by: default avatarMichał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/ecd5d75981b4b21c3da3b1831faceccfe385d898.1772212579.git.jani.nikula@intel.com


Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent dc5f903b
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2023 Intel Corporation
 */
/* Copyright © 2026 Intel Corporation */

#ifndef I915_VMA_H
#define I915_VMA_H

#include <uapi/drm/i915_drm.h>

#include "xe_ggtt.h"
#ifndef _XE_DISPLAY_VMA_H_
#define _XE_DISPLAY_VMA_H_

#include <linux/refcount.h>

/* We don't want these from i915_drm.h in case of Xe */
#undef I915_TILING_X
#undef I915_TILING_Y
#define I915_TILING_X 0
#define I915_TILING_Y 0

struct xe_bo;
struct xe_ggtt_node;

struct i915_vma {
	refcount_t ref;
@@ -26,9 +15,4 @@ struct i915_vma {
	struct xe_ggtt_node *node;
};

static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
{
	return xe_ggtt_node_addr(vma->node);
}

#endif
+3 −3
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@

#include <drm/ttm/ttm_bo.h>

#include "i915_vma.h"
#include "intel_display_core.h"
#include "intel_display_types.h"
#include "intel_fb.h"
@@ -13,6 +12,7 @@
#include "intel_fbdev.h"
#include "xe_bo.h"
#include "xe_device.h"
#include "xe_display_vma.h"
#include "xe_ggtt.h"
#include "xe_pm.h"
#include "xe_vram_types.h"
@@ -409,7 +409,7 @@ static bool reuse_vma(struct intel_plane_state *new_plane_state,
	refcount_inc(&vma->ref);
	new_plane_state->ggtt_vma = vma;

	new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) +
	new_plane_state->surf = xe_ggtt_node_addr(new_plane_state->ggtt_vma->node) +
		plane->surf_offset(new_plane_state);

	return true;
@@ -439,7 +439,7 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state,

	new_plane_state->ggtt_vma = vma;

	new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) +
	new_plane_state->surf = xe_ggtt_node_addr(new_plane_state->ggtt_vma->node) +
		plane->surf_offset(new_plane_state);

	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#include "xe_ggtt.h"
#include "xe_mmio.h"

#include "i915_vma.h"
#include "intel_crtc.h"
#include "intel_display_regs.h"
#include "intel_display_types.h"
@@ -20,6 +19,7 @@
#include "intel_fbdev_fb.h"
#include "intel_fb_pin.h"
#include "xe_bo.h"
#include "xe_display_vma.h"
#include "xe_vram_types.h"
#include "xe_wa.h"

@@ -165,7 +165,7 @@ xe_initial_plane_setup(struct drm_plane_state *_plane_state,

	plane_state->ggtt_vma = vma;

	plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma);
	plane_state->surf = xe_ggtt_node_addr(plane_state->ggtt_vma->node);

	plane_config->vma = vma;