mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
drm/xe/display: Implement display support
As for display, the intent is to share the display code with the i915 driver so that there is maximum reuse there. We do this by recompiling i915/display code twice. Now that i915 has been adapted to support the Xe build, we can add the xe/display support. This initial work is a collaboration of many people and unfortunately this squashed patch won't fully honor the proper credits. But let's try to add a few from the squashed patches: Co-developed-by: Matthew Brost <matthew.brost@intel.com> Co-developed-by: Jani Nikula <jani.nikula@intel.com> Co-developed-by: Lucas De Marchi <lucas.demarchi@intel.com> Co-developed-by: Matt Roper <matthew.d.roper@intel.com> Co-developed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Co-developed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Co-developed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
committed by
Rodrigo Vivi
parent
a839e365ac
commit
44e694958b
@@ -6,6 +6,7 @@ CONFIG_DRM=y
|
||||
CONFIG_DRM_FBDEV_EMULATION=y
|
||||
CONFIG_DRM_KMS_HELPER=y
|
||||
CONFIG_DRM_XE=y
|
||||
CONFIG_DRM_XE_DISPLAY=n
|
||||
CONFIG_EXPERT=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_DRM_XE_KUNIT_TEST=y
|
||||
|
||||
@@ -12,8 +12,20 @@ config DRM_XE
|
||||
select DRM_KMS_HELPER
|
||||
select DRM_PANEL
|
||||
select DRM_SUBALLOC_HELPER
|
||||
select DRM_DISPLAY_DP_HELPER
|
||||
select DRM_DISPLAY_HDCP_HELPER
|
||||
select DRM_DISPLAY_HDMI_HELPER
|
||||
select DRM_DISPLAY_HELPER
|
||||
select DRM_MIPI_DSI
|
||||
select RELAY
|
||||
select IRQ_WORK
|
||||
# i915 depends on ACPI_VIDEO when ACPI is enabled
|
||||
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
|
||||
select BACKLIGHT_CLASS_DEVICE if ACPI
|
||||
select INPUT if ACPI
|
||||
select ACPI_VIDEO if X86 && ACPI
|
||||
select ACPI_BUTTON if ACPI
|
||||
select ACPI_WMI if ACPI
|
||||
select SYNC_FILE
|
||||
select IOSF_MBI
|
||||
select CRC32
|
||||
@@ -33,6 +45,16 @@ config DRM_XE
|
||||
|
||||
If "M" is selected, the module will be called xe.
|
||||
|
||||
config DRM_XE_DISPLAY
|
||||
bool "Enable display support"
|
||||
depends on DRM_XE && EXPERT && DRM_XE=m
|
||||
select FB_IOMEM_HELPERS
|
||||
select I2C
|
||||
select I2C_ALGOBIT
|
||||
default y
|
||||
help
|
||||
Disable this option only if you want to compile out display support.
|
||||
|
||||
config DRM_XE_FORCE_PROBE
|
||||
string "Force probe xe for selected Intel hardware IDs"
|
||||
depends on DRM_XE
|
||||
|
||||
+136
-5
@@ -24,9 +24,6 @@ subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
|
||||
subdir-ccflags-y += $(call cc-disable-warning, frame-address)
|
||||
subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
|
||||
|
||||
# Fine grained warnings disable
|
||||
CFLAGS_xe_pci.o = $(call cc-disable-warning, override-init)
|
||||
|
||||
subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
|
||||
|
||||
# generated sources
|
||||
@@ -126,13 +123,147 @@ xe-y += xe_bb.o \
|
||||
# graphics hardware monitoring (HWMON) support
|
||||
xe-$(CONFIG_HWMON) += xe_hwmon.o
|
||||
|
||||
obj-$(CONFIG_DRM_XE) += xe.o
|
||||
obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
|
||||
# i915 Display compat #defines and #includes
|
||||
subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
|
||||
-I$(srctree)/$(src)/display/ext \
|
||||
-I$(srctree)/$(src)/compat-i915-headers \
|
||||
-I$(srctree)/drivers/gpu/drm/xe/display/ \
|
||||
-I$(srctree)/drivers/gpu/drm/i915/display/ \
|
||||
-Ddrm_i915_gem_object=xe_bo \
|
||||
-Ddrm_i915_private=xe_device
|
||||
|
||||
CFLAGS_i915-display/intel_fbdev.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_i915-display/intel_display_device.o = $(call cc-disable-warning, override-init)
|
||||
|
||||
# Rule to build SOC code shared with i915
|
||||
$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
|
||||
$(call cmd,force_checksrc)
|
||||
$(call if_changed_rule,cc_o_c)
|
||||
|
||||
# Rule to build display code shared with i915
|
||||
$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
|
||||
$(call cmd,force_checksrc)
|
||||
$(call if_changed_rule,cc_o_c)
|
||||
|
||||
# Display code specific to xe
|
||||
xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
||||
xe_display.o \
|
||||
display/xe_fb_pin.o \
|
||||
display/xe_hdcp_gsc.o \
|
||||
display/xe_plane_initial.o \
|
||||
display/xe_display_rps.o \
|
||||
display/intel_fbdev_fb.o \
|
||||
display/intel_fb_bo.o \
|
||||
display/ext/i915_irq.o \
|
||||
display/ext/i915_utils.o
|
||||
|
||||
# SOC code shared with i915
|
||||
xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
||||
i915-soc/intel_dram.o \
|
||||
i915-soc/intel_pch.o
|
||||
|
||||
# Display code shared with i915
|
||||
xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
||||
i915-display/icl_dsi.o \
|
||||
i915-display/intel_atomic.o \
|
||||
i915-display/intel_atomic_plane.o \
|
||||
i915-display/intel_audio.o \
|
||||
i915-display/intel_backlight.o \
|
||||
i915-display/intel_bios.o \
|
||||
i915-display/intel_bw.o \
|
||||
i915-display/intel_cdclk.o \
|
||||
i915-display/intel_color.o \
|
||||
i915-display/intel_combo_phy.o \
|
||||
i915-display/intel_connector.o \
|
||||
i915-display/intel_crtc.o \
|
||||
i915-display/intel_crtc_state_dump.o \
|
||||
i915-display/intel_cursor.o \
|
||||
i915-display/intel_cx0_phy.o \
|
||||
i915-display/intel_ddi.o \
|
||||
i915-display/intel_ddi_buf_trans.o \
|
||||
i915-display/intel_display.o \
|
||||
i915-display/intel_display_debugfs.o \
|
||||
i915-display/intel_display_debugfs_params.o \
|
||||
i915-display/intel_display_device.o \
|
||||
i915-display/intel_display_driver.o \
|
||||
i915-display/intel_display_irq.o \
|
||||
i915-display/intel_display_params.o \
|
||||
i915-display/intel_display_power.o \
|
||||
i915-display/intel_display_power_map.o \
|
||||
i915-display/intel_display_power_well.o \
|
||||
i915-display/intel_display_trace.o \
|
||||
i915-display/intel_display_wa.o \
|
||||
i915-display/intel_dkl_phy.o \
|
||||
i915-display/intel_dmc.o \
|
||||
i915-display/intel_dp.o \
|
||||
i915-display/intel_dp_aux.o \
|
||||
i915-display/intel_dp_aux_backlight.o \
|
||||
i915-display/intel_dp_hdcp.o \
|
||||
i915-display/intel_dp_link_training.o \
|
||||
i915-display/intel_dp_mst.o \
|
||||
i915-display/intel_dpll.o \
|
||||
i915-display/intel_dpll_mgr.o \
|
||||
i915-display/intel_dpt_common.o \
|
||||
i915-display/intel_drrs.o \
|
||||
i915-display/intel_dsb.o \
|
||||
i915-display/intel_dsi.o \
|
||||
i915-display/intel_dsi_dcs_backlight.o \
|
||||
i915-display/intel_dsi_vbt.o \
|
||||
i915-display/intel_fb.o \
|
||||
i915-display/intel_fbc.o \
|
||||
i915-display/intel_fdi.o \
|
||||
i915-display/intel_fifo_underrun.o \
|
||||
i915-display/intel_frontbuffer.o \
|
||||
i915-display/intel_global_state.o \
|
||||
i915-display/intel_gmbus.o \
|
||||
i915-display/intel_hdcp.o \
|
||||
i915-display/intel_hdmi.o \
|
||||
i915-display/intel_hotplug.o \
|
||||
i915-display/intel_hotplug_irq.o \
|
||||
i915-display/intel_hti.o \
|
||||
i915-display/intel_link_bw.o \
|
||||
i915-display/intel_lspcon.o \
|
||||
i915-display/intel_modeset_lock.o \
|
||||
i915-display/intel_modeset_setup.o \
|
||||
i915-display/intel_modeset_verify.o \
|
||||
i915-display/intel_panel.o \
|
||||
i915-display/intel_pipe_crc.o \
|
||||
i915-display/intel_pmdemand.o \
|
||||
i915-display/intel_pps.o \
|
||||
i915-display/intel_psr.o \
|
||||
i915-display/intel_qp_tables.o \
|
||||
i915-display/intel_quirks.o \
|
||||
i915-display/intel_snps_phy.o \
|
||||
i915-display/intel_tc.o \
|
||||
i915-display/intel_vblank.o \
|
||||
i915-display/intel_vdsc.o \
|
||||
i915-display/intel_vga.o \
|
||||
i915-display/intel_vrr.o \
|
||||
i915-display/intel_wm.o \
|
||||
i915-display/skl_scaler.o \
|
||||
i915-display/skl_universal_plane.o \
|
||||
i915-display/skl_watermark.o
|
||||
|
||||
xe-$(CONFIG_PERF_EVENTS) += xe_pmu.o
|
||||
|
||||
ifeq ($(CONFIG_ACPI),y)
|
||||
xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
||||
i915-display/intel_acpi.o \
|
||||
i915-display/intel_opregion.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DRM_FBDEV_EMULATION),y)
|
||||
xe-$(CONFIG_DRM_XE_DISPLAY) += i915-display/intel_fbdev.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_DRM_XE) += xe.o
|
||||
obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
|
||||
|
||||
# header test
|
||||
hdrtest_find_args := -not -path xe_rtp_helpers.h
|
||||
ifneq ($(CONFIG_DRM_XE_DISPLAY),y)
|
||||
hdrtest_find_args += -not -path display/\* -not -path compat-i915-headers/\* -not -path xe_display.h
|
||||
endif
|
||||
|
||||
always-$(CONFIG_DRM_XE_WERROR) += \
|
||||
$(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args)))
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/* Empty */
|
||||
@@ -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
|
||||
@@ -0,0 +1,65 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2022 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _I915_GEM_OBJECT_H_
|
||||
#define _I915_GEM_OBJECT_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "xe_bo.h"
|
||||
|
||||
#define i915_gem_object_is_shmem(obj) ((obj)->flags & XE_BO_CREATE_SYSTEM_BIT)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
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
|
||||
@@ -0,0 +1,11 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __INTEL_RPS_H__
|
||||
#define __INTEL_RPS_H__
|
||||
|
||||
#define gen5_rps_irq_handler(x) ({})
|
||||
|
||||
#endif /* __INTEL_RPS_H__ */
|
||||
@@ -0,0 +1,19 @@
|
||||
/* 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__ */
|
||||
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __I915_DEBUGFS_H__
|
||||
#define __I915_DEBUGFS_H__
|
||||
|
||||
struct drm_i915_gem_object;
|
||||
struct seq_file;
|
||||
|
||||
static inline void i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) {}
|
||||
|
||||
#endif /* __I915_DEBUGFS_H__ */
|
||||
@@ -0,0 +1,230 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
#ifndef _XE_I915_DRV_H_
|
||||
#define _XE_I915_DRV_H_
|
||||
|
||||
/*
|
||||
* "Adaptation header" to allow i915 display to also build for xe driver.
|
||||
* TODO: refactor i915 and xe so this can cease to exist
|
||||
*/
|
||||
|
||||
#include <drm/drm_drv.h>
|
||||
|
||||
#include "gem/i915_gem_object.h"
|
||||
|
||||
#include "soc/intel_pch.h"
|
||||
#include "xe_device.h"
|
||||
#include "xe_bo.h"
|
||||
#include "xe_pm.h"
|
||||
#include "xe_step.h"
|
||||
#include "i915_gpu_error.h"
|
||||
#include "i915_reg_defs.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_step.h"
|
||||
#include "intel_uc_fw.h"
|
||||
#include "intel_uncore.h"
|
||||
#include "intel_runtime_pm.h"
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
|
||||
{
|
||||
return container_of(dev, struct drm_i915_private, drm);
|
||||
}
|
||||
|
||||
static inline struct drm_i915_private *kdev_to_i915(struct device *kdev)
|
||||
{
|
||||
return dev_get_drvdata(kdev);
|
||||
}
|
||||
|
||||
|
||||
#define INTEL_JASPERLAKE 0
|
||||
#define INTEL_ELKHARTLAKE 0
|
||||
#define IS_PLATFORM(xe, x) ((xe)->info.platform == x)
|
||||
#define INTEL_INFO(dev_priv) (&((dev_priv)->info))
|
||||
#define INTEL_DEVID(dev_priv) ((dev_priv)->info.devid)
|
||||
#define IS_I830(dev_priv) (dev_priv && 0)
|
||||
#define IS_I845G(dev_priv) (dev_priv && 0)
|
||||
#define IS_I85X(dev_priv) (dev_priv && 0)
|
||||
#define IS_I865G(dev_priv) (dev_priv && 0)
|
||||
#define IS_I915G(dev_priv) (dev_priv && 0)
|
||||
#define IS_I915GM(dev_priv) (dev_priv && 0)
|
||||
#define IS_I945G(dev_priv) (dev_priv && 0)
|
||||
#define IS_I945GM(dev_priv) (dev_priv && 0)
|
||||
#define IS_I965G(dev_priv) (dev_priv && 0)
|
||||
#define IS_I965GM(dev_priv) (dev_priv && 0)
|
||||
#define IS_G45(dev_priv) (dev_priv && 0)
|
||||
#define IS_GM45(dev_priv) (dev_priv && 0)
|
||||
#define IS_G4X(dev_priv) (dev_priv && 0)
|
||||
#define IS_PINEVIEW(dev_priv) (dev_priv && 0)
|
||||
#define IS_G33(dev_priv) (dev_priv && 0)
|
||||
#define IS_IRONLAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_IRONLAKE_M(dev_priv) (dev_priv && 0)
|
||||
#define IS_SANDYBRIDGE(dev_priv) (dev_priv && 0)
|
||||
#define IS_IVYBRIDGE(dev_priv) (dev_priv && 0)
|
||||
#define IS_IVB_GT1(dev_priv) (dev_priv && 0)
|
||||
#define IS_VALLEYVIEW(dev_priv) (dev_priv && 0)
|
||||
#define IS_CHERRYVIEW(dev_priv) (dev_priv && 0)
|
||||
#define IS_HASWELL(dev_priv) (dev_priv && 0)
|
||||
#define IS_BROADWELL(dev_priv) (dev_priv && 0)
|
||||
#define IS_SKYLAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_BROXTON(dev_priv) (dev_priv && 0)
|
||||
#define IS_KABYLAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_GEMINILAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_COFFEELAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_COMETLAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_ICELAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_JASPERLAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_ELKHARTLAKE(dev_priv) (dev_priv && 0)
|
||||
#define IS_TIGERLAKE(dev_priv) IS_PLATFORM(dev_priv, XE_TIGERLAKE)
|
||||
#define IS_ROCKETLAKE(dev_priv) IS_PLATFORM(dev_priv, XE_ROCKETLAKE)
|
||||
#define IS_DG1(dev_priv) IS_PLATFORM(dev_priv, XE_DG1)
|
||||
#define IS_ALDERLAKE_S(dev_priv) IS_PLATFORM(dev_priv, XE_ALDERLAKE_S)
|
||||
#define IS_ALDERLAKE_P(dev_priv) IS_PLATFORM(dev_priv, XE_ALDERLAKE_P)
|
||||
#define IS_XEHPSDV(dev_priv) (dev_priv && 0)
|
||||
#define IS_DG2(dev_priv) IS_PLATFORM(dev_priv, XE_DG2)
|
||||
#define IS_PONTEVECCHIO(dev_priv) IS_PLATFORM(dev_priv, XE_PVC)
|
||||
#define IS_METEORLAKE(dev_priv) IS_PLATFORM(dev_priv, XE_METEORLAKE)
|
||||
#define IS_LUNARLAKE(dev_priv) IS_PLATFORM(dev_priv, XE_LUNARLAKE)
|
||||
|
||||
#define IS_HASWELL_ULT(dev_priv) (dev_priv && 0)
|
||||
#define IS_BROADWELL_ULT(dev_priv) (dev_priv && 0)
|
||||
#define IS_BROADWELL_ULX(dev_priv) (dev_priv && 0)
|
||||
|
||||
#define IP_VER(ver, rel) ((ver) << 8 | (rel))
|
||||
|
||||
#define INTEL_DISPLAY_ENABLED(xe) (HAS_DISPLAY((xe)) && !intel_opregion_headless_sku((xe)))
|
||||
|
||||
#define IS_GRAPHICS_VER(xe, first, last) \
|
||||
((xe)->info.graphics_verx100 >= first * 100 && \
|
||||
(xe)->info.graphics_verx100 <= (last*100 + 99))
|
||||
#define IS_MOBILE(xe) (xe && 0)
|
||||
#define HAS_LLC(xe) (!IS_DGFX((xe)))
|
||||
|
||||
#define HAS_GMD_ID(xe) GRAPHICS_VERx100(xe) >= 1270
|
||||
|
||||
/* Workarounds not handled yet */
|
||||
#define IS_DISPLAY_STEP(xe, first, last) ({u8 __step = (xe)->info.step.display; first <= __step && __step <= last; })
|
||||
#define IS_GRAPHICS_STEP(xe, first, last) ({u8 __step = (xe)->info.step.graphics; first <= __step && __step <= last; })
|
||||
|
||||
#define IS_LP(xe) (0)
|
||||
#define IS_GEN9_LP(xe) (0)
|
||||
#define IS_GEN9_BC(xe) (0)
|
||||
|
||||
#define IS_TIGERLAKE_UY(xe) (xe && 0)
|
||||
#define IS_COMETLAKE_ULX(xe) (xe && 0)
|
||||
#define IS_COFFEELAKE_ULX(xe) (xe && 0)
|
||||
#define IS_KABYLAKE_ULX(xe) (xe && 0)
|
||||
#define IS_SKYLAKE_ULX(xe) (xe && 0)
|
||||
#define IS_HASWELL_ULX(xe) (xe && 0)
|
||||
#define IS_COMETLAKE_ULT(xe) (xe && 0)
|
||||
#define IS_COFFEELAKE_ULT(xe) (xe && 0)
|
||||
#define IS_KABYLAKE_ULT(xe) (xe && 0)
|
||||
#define IS_SKYLAKE_ULT(xe) (xe && 0)
|
||||
|
||||
#define IS_DG1_GRAPHICS_STEP(xe, first, last) (IS_DG1(xe) && IS_GRAPHICS_STEP(xe, first, last))
|
||||
#define IS_DG2_GRAPHICS_STEP(xe, variant, first, last) \
|
||||
((xe)->info.subplatform == XE_SUBPLATFORM_DG2_ ## variant && \
|
||||
IS_GRAPHICS_STEP(xe, first, last))
|
||||
#define IS_XEHPSDV_GRAPHICS_STEP(xe, first, last) (IS_XEHPSDV(xe) && IS_GRAPHICS_STEP(xe, first, last))
|
||||
|
||||
/* XXX: No basedie stepping support yet */
|
||||
#define IS_PVC_BD_STEP(xe, first, last) (!WARN_ON(1) && IS_PONTEVECCHIO(xe))
|
||||
|
||||
#define IS_TIGERLAKE_DISPLAY_STEP(xe, first, last) (IS_TIGERLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_ROCKETLAKE_DISPLAY_STEP(xe, first, last) (IS_ROCKETLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_DG1_DISPLAY_STEP(xe, first, last) (IS_DG1(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_DG2_DISPLAY_STEP(xe, first, last) (IS_DG2(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_ADLP_DISPLAY_STEP(xe, first, last) (IS_ALDERLAKE_P(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_ADLS_DISPLAY_STEP(xe, first, last) (IS_ALDERLAKE_S(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_JSL_EHL_DISPLAY_STEP(xe, first, last) (IS_JSL_EHL(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
#define IS_MTL_DISPLAY_STEP(xe, first, last) (IS_METEORLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
|
||||
/* FIXME: Add subplatform here */
|
||||
#define IS_MTL_GRAPHICS_STEP(xe, sub, first, last) (IS_METEORLAKE(xe) && IS_DISPLAY_STEP(xe, first, last))
|
||||
|
||||
#define IS_DG2_G10(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_G10)
|
||||
#define IS_DG2_G11(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_G11)
|
||||
#define IS_DG2_G12(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_DG2_G12)
|
||||
#define IS_RAPTORLAKE_U(xe) ((xe)->info.subplatform == XE_SUBPLATFORM_ALDERLAKE_P_RPLU)
|
||||
#define IS_ICL_WITH_PORT_F(xe) (xe && 0)
|
||||
#define HAS_FLAT_CCS(xe) (xe_device_has_flat_ccs(xe))
|
||||
#define to_intel_bo(x) gem_to_xe_bo((x))
|
||||
#define mkwrite_device_info(xe) (INTEL_INFO(xe))
|
||||
|
||||
#define HAS_128_BYTE_Y_TILING(xe) (xe || 1)
|
||||
|
||||
#define intel_has_gpu_reset(a) (a && 0)
|
||||
|
||||
#include "intel_wakeref.h"
|
||||
|
||||
static inline bool intel_runtime_pm_get(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
if (xe_pm_runtime_get(xe) < 0) {
|
||||
xe_pm_runtime_put(xe);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool intel_runtime_pm_get_if_in_use(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
return xe_pm_runtime_get_if_active(xe);
|
||||
}
|
||||
|
||||
static inline void intel_runtime_pm_put_unchecked(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
xe_pm_runtime_put(xe);
|
||||
}
|
||||
|
||||
static inline void intel_runtime_pm_put(struct xe_runtime_pm *pm, bool wakeref)
|
||||
{
|
||||
if (wakeref)
|
||||
intel_runtime_pm_put_unchecked(pm);
|
||||
}
|
||||
|
||||
#define intel_runtime_pm_get_raw intel_runtime_pm_get
|
||||
#define intel_runtime_pm_put_raw intel_runtime_pm_put
|
||||
#define assert_rpm_wakelock_held(x) do { } while (0)
|
||||
#define assert_rpm_raw_wakeref_held(x) do { } while (0)
|
||||
|
||||
#define intel_uncore_forcewake_get(x, y) do { } while (0)
|
||||
#define intel_uncore_forcewake_put(x, y) do { } while (0)
|
||||
|
||||
#define intel_uncore_arm_unclaimed_mmio_detection(x) do { } while (0)
|
||||
|
||||
#define I915_PRIORITY_DISPLAY 0
|
||||
struct i915_sched_attr {
|
||||
int priority;
|
||||
};
|
||||
#define i915_gem_fence_wait_priority(fence, attr) do { (void) attr; } while (0)
|
||||
|
||||
#define with_intel_runtime_pm(rpm, wf) \
|
||||
for ((wf) = intel_runtime_pm_get(rpm); (wf); \
|
||||
intel_runtime_pm_put((rpm), (wf)), (wf) = 0)
|
||||
|
||||
#define pdev_to_i915 pdev_to_xe_device
|
||||
#define RUNTIME_INFO(xe) (&(xe)->info.i915_runtime)
|
||||
|
||||
#define FORCEWAKE_ALL XE_FORCEWAKE_ALL
|
||||
#define HPD_STORM_DEFAULT_THRESHOLD 50
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
/*
|
||||
* arm64 indirectly includes linux/rtc.h,
|
||||
* which defines a irq_lock, so include it
|
||||
* here before #define-ing it
|
||||
*/
|
||||
#include <linux/rtc.h>
|
||||
#endif
|
||||
|
||||
#define irq_lock irq.lock
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "../../i915/i915_fixed.h"
|
||||
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _I915_GPU_ERROR_H_
|
||||
#define _I915_GPU_ERROR_H_
|
||||
|
||||
struct drm_i915_error_state_buf;
|
||||
|
||||
__printf(2, 3)
|
||||
static inline void
|
||||
i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "../../i915/i915_irq.h"
|
||||
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "../../i915/i915_reg.h"
|
||||
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "../../i915/i915_reg_defs.h"
|
||||
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#define trace_i915_reg_rw(a...) do { } while (0)
|
||||
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "../../i915/i915_utils.h"
|
||||
@@ -0,0 +1,44 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _I915_VGPU_H_
|
||||
#define _I915_VGPU_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct i915_ggtt;
|
||||
|
||||
static inline void intel_vgpu_detect(struct drm_i915_private *i915)
|
||||
{
|
||||
}
|
||||
static inline bool intel_vgpu_active(struct drm_i915_private *i915)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void intel_vgpu_register(struct drm_i915_private *i915)
|
||||
{
|
||||
}
|
||||
static inline bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *i915)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline bool intel_vgpu_has_hwsp_emulation(struct drm_i915_private *i915)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline bool intel_vgpu_has_huge_gtt(struct drm_i915_private *i915)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline int intel_vgt_balloon(struct i915_ggtt *ggtt)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void intel_vgt_deballoon(struct i915_ggtt *ggtt)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* _I915_VGPU_H_ */
|
||||
@@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef I915_VMA_H
|
||||
#define I915_VMA_H
|
||||
|
||||
#include <uapi/drm/i915_drm.h>
|
||||
#include <drm/drm_mm.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 i915_vma {
|
||||
struct xe_bo *bo, *dpt;
|
||||
struct drm_mm_node node;
|
||||
};
|
||||
|
||||
|
||||
static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
|
||||
{
|
||||
return vma->node.start;
|
||||
}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user