From ba6ae7b1349132f1f9dd0e427c2188f24121da12 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Sun, 12 Nov 2023 14:08:33 +0300 Subject: [PATCH] Reduce diff with Linux 5.19 Sponsored by: Serenity Cyber Security, LLC --- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c | 4 +++- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 6 ----- drivers/gpu/drm/amd/include/amd_shared.h | 4 ---- drivers/gpu/drm/amd/pm/powerplay/inc/smumgr.h | 3 --- drivers/gpu/drm/drm_atomic_helper.c | 2 -- drivers/gpu/drm/drm_bridge.c | 2 -- drivers/gpu/drm/drm_flip_work.c | 4 ---- drivers/gpu/drm/drm_internal.h | 4 ---- drivers/gpu/drm/i915/display/intel_dmc_regs.h | 16 +++++++++++++ drivers/gpu/drm/i915/display/intel_fbc.c | 1 + drivers/gpu/drm/i915/display/intel_fbdev.c | 4 ++-- drivers/gpu/drm/i915/display/intel_hdcp.c | 5 ---- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 5 ---- drivers/gpu/drm/i915/gt/intel_ggtt.c | 4 ---- drivers/gpu/drm/i915/gt/shmem_utils.c | 4 ---- .../gt/uc/abi/guc_communication_ctb_abi.h | 2 -- drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h | 2 -- drivers/gpu/drm/i915/i915_pci.c | 1 + drivers/gpu/drm/i915/i915_reg.h | 23 ------------------- drivers/gpu/drm/i915/i915_user_extensions.c | 4 ---- drivers/gpu/drm/i915/i915_vma_resource.h | 4 ---- drivers/gpu/drm/i915/intel_uncore.h | 5 ---- drivers/gpu/drm/ttm/ttm_module.c | 4 ---- include/drm/display/drm_dp.h | 1 + include/drm/display/drm_dp_helper.h | 1 + include/drm/drm_file.h | 2 -- include/drm/drm_gem.h | 4 ---- include/drm/drm_gem_atomic_helper.h | 0 include/drm/drm_legacy.h | 8 ------- include/drm/drm_of.h | 0 include/drm/gpu_scheduler.h | 4 ---- include/drm/ttm/ttm_resource.h | 1 - 32 files changed, 25 insertions(+), 109 deletions(-) create mode 100644 include/drm/drm_gem_atomic_helper.h create mode 100644 include/drm/drm_of.h diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c index 0b9887966d3..9b6a2c9671c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c @@ -213,8 +213,10 @@ int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih) restart_ih: count = AMDGPU_IH_MAX_NUM_IVS; +#ifdef __linux__ /* BSD: Too verbose, disable */ - /* DRM_DEBUG("%s: rptr %d, wptr %d\n", __func__, ih->rptr, wptr); */ + DRM_DEBUG("%s: rptr %d, wptr %d\n", __func__, ih->rptr, wptr); +#endif /* Order reading of wptr vs. reading of IH ring data */ rmb(); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index e05b1f8b097..a71177305bc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -22,12 +22,6 @@ * Authors: AMD * */ - -#ifdef __FreeBSD__ -/* For lower_32_bits() */ -#include -#endif - #include "amdgpu.h" #include "amdgpu_mode.h" #include "amdgpu_dm.h" diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 68fb4caaa4a..bcdf7453a40 100644 --- a/drivers/gpu/drm/amd/include/amd_shared.h +++ b/drivers/gpu/drm/amd/include/amd_shared.h @@ -25,10 +25,6 @@ #include -#ifdef __FreeBSD__ -// Fix compile error -#include -#endif #define AMD_MAX_USEC_TIMEOUT 1000000 /* 1000 ms */ diff --git a/drivers/gpu/drm/amd/pm/powerplay/inc/smumgr.h b/drivers/gpu/drm/amd/pm/powerplay/inc/smumgr.h index 4b069bf0cb1..5f46f1a4f38 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/inc/smumgr.h +++ b/drivers/gpu/drm/amd/pm/powerplay/inc/smumgr.h @@ -23,9 +23,6 @@ #ifndef _SMUMGR_H_ #define _SMUMGR_H_ #include -#ifdef __FreeBSD__ -#include -#endif #include "amd_powerplay.h" #include "hwmgr.h" diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index fc26c49cfa9..4c571d0ec61 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -35,9 +35,7 @@ #include #include #include -#ifdef __linux__ #include -#endif #include #include #include diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 1780114643f..c96847fc0eb 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -28,9 +28,7 @@ #include #include #include -#ifdef __linux__ #include -#endif #include #include "drm_crtc_internal.h" diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c index 83bcf6544ee..060b753881a 100644 --- a/drivers/gpu/drm/drm_flip_work.c +++ b/drivers/gpu/drm/drm_flip_work.c @@ -23,10 +23,6 @@ #include -#ifdef __FreeBSD__ -#include -#endif - #include #include #include diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index 92febb17765..3f60b6dfbe6 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -26,10 +26,6 @@ #include #include -#ifdef __FreeBSD__ -#include /* Needed by the debugfs funcs */ -#endif - #define DRM_IF_MAJOR 1 #define DRM_IF_MINOR 4 diff --git a/drivers/gpu/drm/i915/display/intel_dmc_regs.h b/drivers/gpu/drm/i915/display/intel_dmc_regs.h index d65e698832e..7853827988d 100644 --- a/drivers/gpu/drm/i915/display/intel_dmc_regs.h +++ b/drivers/gpu/drm/i915/display/intel_dmc_regs.h @@ -17,6 +17,22 @@ #define DMC_LAST_WRITE_VALUE 0xc003b400 #define DMC_MMIO_START_RANGE 0x80000 #define DMC_MMIO_END_RANGE 0x8FFFF +#define DMC_V1_MMIO_START_RANGE 0x80000 +#define TGL_MAIN_MMIO_START 0x8F000 +#define TGL_MAIN_MMIO_END 0x8FFFF +#define _TGL_PIPEA_MMIO_START 0x92000 +#define _TGL_PIPEA_MMIO_END 0x93FFF +#define _TGL_PIPEB_MMIO_START 0x96000 +#define _TGL_PIPEB_MMIO_END 0x97FFF +#define ADLP_PIPE_MMIO_START 0x5F000 +#define ADLP_PIPE_MMIO_END 0x5FFFF + +#define TGL_PIPE_MMIO_START(dmc_id) _PICK_EVEN(((dmc_id) - 1), _TGL_PIPEA_MMIO_START,\ + _TGL_PIPEB_MMIO_START) + +#define TGL_PIPE_MMIO_END(dmc_id) _PICK_EVEN(((dmc_id) - 1), _TGL_PIPEA_MMIO_END,\ + _TGL_PIPEB_MMIO_END) + #define SKL_DMC_DC3_DC5_COUNT _MMIO(0x80030) #define SKL_DMC_DC5_DC6_COUNT _MMIO(0x8002C) #define BXT_DMC_DC3_DC5_COUNT _MMIO(0x80038) diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index 99094348f72..bbdc34a23d5 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -1166,6 +1166,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state, return 0; } + static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 02795e4cedf..e247cb6e10d 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -281,7 +281,7 @@ static int intelfb_create(struct drm_fb_helper *helper, /* Our framebuffer is the entirety of fbdev's system memory */ info->fix.smem_start = (unsigned long)(ggtt->gmadr.start + vma->node.start); - info->fix.smem_len = vma->node.size; + info->fix.smem_len = vma->size; } #ifdef __FreeBSD__ @@ -311,7 +311,7 @@ static int intelfb_create(struct drm_fb_helper *helper, goto out_unpin; } info->screen_base = vaddr; - info->screen_size = vma->node.size; + info->screen_size = vma->size; drm_fb_helper_fill_info(info, &ifbdev->helper, sizes); diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index bfe41b760e5..71c7ef7ac41 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -12,11 +12,6 @@ #include #include -#ifdef __FreeBSD__ -#include -#include -#endif - #include #include diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c index 78620126e05..f8c96ae3b08 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c @@ -12,11 +12,6 @@ #include "i915_gem_lmem.h" #include "i915_gem_mman.h" -#ifdef __FreeBSD__ -#include -#include -#endif - #include "gt/intel_gt.h" void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj, diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c index 43b020c2abd..e6b2eb122ad 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -22,10 +22,6 @@ #include "intel_gtt.h" #include "gen8_ppgtt.h" -#ifdef __FreeBSD__ -#include -#endif - static void i915_ggtt_color_adjust(const struct drm_mm_node *node, unsigned long color, u64 *start, diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c index a324151ac5e..663922a504c 100644 --- a/drivers/gpu/drm/i915/gt/shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c @@ -8,10 +8,6 @@ #include #include -#ifdef __FreeBSD__ -#include -#endif - #include "gem/i915_gem_object.h" #include "gem/i915_gem_lmem.h" #include "shmem_utils.h" diff --git a/drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h b/drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h index a1f79b2a96b..df83c1cc7c7 100644 --- a/drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h +++ b/drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h @@ -54,9 +54,7 @@ struct guc_ct_buffer_desc { #define GUC_CTB_STATUS_MISMATCH (1 << 2) u32 reserved[13]; } __packed; -#ifdef __linux__ static_assert(sizeof(struct guc_ct_buffer_desc) == 64); -#endif /** * DOC: CTB Message diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h index b13fa927426..e41ffc7a7fb 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h @@ -76,8 +76,6 @@ struct uc_css_header { }; u32 header_info; } __packed; -#ifdef __linux__ static_assert(sizeof(struct uc_css_header) == 128); -#endif #endif /* _INTEL_UC_FW_ABI_H */ diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 2fec513ef05..5192748e70a 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -1053,6 +1053,7 @@ static const struct intel_device_info xehpsdv_info = { .has_64k_pages = 1, \ .has_guc_deprivilege = 1, \ .has_heci_pxp = 1, \ + .needs_compact_pt = 1, \ .platform_engine_mask = \ BIT(RCS0) | BIT(BCS0) | \ BIT(VECS0) | BIT(VECS1) | \ diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 31a0945d946..1ae7c751322 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -5518,29 +5518,6 @@ #define GAMMA_MODE_MODE_SPLIT (3 << 0) /* ivb-bdw */ #define GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED (3 << 0) /* icl + */ -#define DMC_V1_MMIO_START_RANGE 0x80000 -#define TGL_MAIN_MMIO_START 0x8F000 -#define TGL_MAIN_MMIO_END 0x8FFFF -#define _TGL_PIPEA_MMIO_START 0x92000 -#define _TGL_PIPEA_MMIO_END 0x93FFF -#define _TGL_PIPEB_MMIO_START 0x96000 -#define _TGL_PIPEB_MMIO_END 0x97FFF -#define ADLP_PIPE_MMIO_START 0x5F000 -#define ADLP_PIPE_MMIO_END 0x5FFFF - -#define TGL_PIPE_MMIO_START(dmc_id) _PICK_EVEN(((dmc_id) - 1), _TGL_PIPEA_MMIO_START,\ - _TGL_PIPEB_MMIO_START) - -#define TGL_PIPE_MMIO_END(dmc_id) _PICK_EVEN(((dmc_id) - 1), _TGL_PIPEA_MMIO_END,\ - _TGL_PIPEB_MMIO_END) - -#define SKL_DMC_DC3_DC5_COUNT _MMIO(0x80030) -#define SKL_DMC_DC5_DC6_COUNT _MMIO(0x8002C) -#define BXT_DMC_DC3_DC5_COUNT _MMIO(0x80038) -#define TGL_DMC_DEBUG_DC5_COUNT _MMIO(0x101084) -#define TGL_DMC_DEBUG_DC6_COUNT _MMIO(0x101088) -#define DG1_DMC_DEBUG_DC5_COUNT _MMIO(0x134154) - /* Display Internal Timeout Register */ #define RM_TIMEOUT _MMIO(0x42060) #define MMIO_TIMEOUT_US(us) ((us) << 0) diff --git a/drivers/gpu/drm/i915/i915_user_extensions.c b/drivers/gpu/drm/i915/i915_user_extensions.c index 7883100f70e..c822d0aafd2 100644 --- a/drivers/gpu/drm/i915/i915_user_extensions.c +++ b/drivers/gpu/drm/i915/i915_user_extensions.c @@ -10,10 +10,6 @@ #include -#ifdef __FreeBSD__ -#include /* For struct delayed_work*/ -#endif - #include "i915_user_extensions.h" #include "i915_utils.h" diff --git a/drivers/gpu/drm/i915/i915_vma_resource.h b/drivers/gpu/drm/i915/i915_vma_resource.h index 7399787c403..5d8427caa2b 100644 --- a/drivers/gpu/drm/i915/i915_vma_resource.h +++ b/drivers/gpu/drm/i915/i915_vma_resource.h @@ -6,10 +6,6 @@ #ifndef __I915_VMA_RESOURCE_H__ #define __I915_VMA_RESOURCE_H__ -#ifdef __FreeBSD__ -#include -#endif - #include #include diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h index f1ef2bccf1a..d6be06c0e80 100644 --- a/drivers/gpu/drm/i915/intel_uncore.h +++ b/drivers/gpu/drm/i915/intel_uncore.h @@ -31,11 +31,6 @@ #include #include -#ifdef __FreeBSD__ -#include /* For container_of */ -#include /* For writeb/readb */ -#endif - #include "i915_reg_defs.h" struct drm_i915_private; diff --git a/drivers/gpu/drm/ttm/ttm_module.c b/drivers/gpu/drm/ttm/ttm_module.c index cc945a72ec6..7d242702341 100644 --- a/drivers/gpu/drm/ttm/ttm_module.c +++ b/drivers/gpu/drm/ttm/ttm_module.c @@ -38,11 +38,7 @@ #include #ifdef __FreeBSD__ -#include -#include - #include - SYSCTL_NODE(_hw, OID_AUTO, ttm, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TTM memory manager parameters"); diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index 37093b1b9cb..9e3aff7e68b 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -369,6 +369,7 @@ # define DP_PSR_SETUP_TIME_SHIFT 1 # define DP_PSR2_SU_Y_COORDINATE_REQUIRED (1 << 4) /* eDP 1.4a */ # define DP_PSR2_SU_GRANULARITY_REQUIRED (1 << 5) /* eDP 1.4b */ +# define DP_PSR2_SU_AUX_FRAME_SYNC_NOT_NEEDED (1 << 6)/* eDP 1.5, adopted eDP 1.4b SCR */ #define DP_PSR2_SU_X_GRANULARITY 0x072 /* eDP 1.4b */ #define DP_PSR2_SU_Y_GRANULARITY 0x074 /* eDP 1.4b */ diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h index d35f59824c7..dca40a045dd 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -25,6 +25,7 @@ #include #include + #include #include diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 5847dd5087a..a67dea22cca 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -75,9 +75,7 @@ struct drm_minor { struct drm_device *dev; #ifdef __FreeBSD__ - device_t bsd_kdev; /* OS device */ struct cdev *bsd_device; /* Device number for mknod */ - struct sigio *buf_sigio; /* Processes waiting for SIGIO */ #endif struct dentry *debugfs_root; diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 555f4d665a3..9d7c61a122d 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -37,10 +37,6 @@ #include #include -#ifdef __FreeBSD__ -#include -#endif - #include struct iosys_map; diff --git a/include/drm/drm_gem_atomic_helper.h b/include/drm/drm_gem_atomic_helper.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h index ec3beb0f937..7fa549296c0 100644 --- a/include/drm/drm_legacy.h +++ b/include/drm/drm_legacy.h @@ -98,10 +98,6 @@ typedef struct drm_dma_handle { dma_addr_t busaddr; void *vaddr; size_t size; -#ifdef __FreeBSD__ - bus_dma_tag_t tag; - bus_dmamap_t map; -#endif } drm_dma_handle_t; /** @@ -146,11 +142,7 @@ struct drm_device_dma { struct drm_sg_mem { unsigned long handle; void *virtual; -#ifdef __linux__ int pages; -#elif defined(__FreeBSD__) - vm_pindex_t pages; -#endif struct page **pagelist; dma_addr_t *busaddr; }; diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 041d35afb5b..addb135eeea 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -30,10 +30,6 @@ #include #include -#ifdef __FreeBSD__ -#include -#endif - #define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000) struct drm_gem_object; diff --git a/include/drm/ttm/ttm_resource.h b/include/drm/ttm/ttm_resource.h index 58dbc45979c..ca89a48c246 100644 --- a/include/drm/ttm/ttm_resource.h +++ b/include/drm/ttm/ttm_resource.h @@ -28,7 +28,6 @@ #include #include #include -#include #include #include