Skip to content

Commit

Permalink
Reduce diff with Linux 5.19
Browse files Browse the repository at this point in the history
Sponsored by:	Serenity Cyber Security, LLC
  • Loading branch information
wulf7 committed Dec 10, 2023
1 parent 4bd589f commit ba6ae7b
Show file tree
Hide file tree
Showing 32 changed files with 25 additions and 109 deletions.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 0 additions & 6 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
* Authors: AMD
*
*/

#ifdef __FreeBSD__
/* For lower_32_bits() */
#include <drm/drm_os_freebsd.h>
#endif

#include "amdgpu.h"
#include "amdgpu_mode.h"
#include "amdgpu_dm.h"
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/amd/include/amd_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

#include <drm/amd_asic_type.h>

#ifdef __FreeBSD__
// Fix compile error
#include <linux/seq_file.h>
#endif

#define AMD_MAX_USEC_TIMEOUT 1000000 /* 1000 ms */

Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/amd/pm/powerplay/inc/smumgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#ifndef _SMUMGR_H_
#define _SMUMGR_H_
#include <linux/types.h>
#ifdef __FreeBSD__
#include <linux/math64.h>
#endif
#include "amd_powerplay.h"
#include "hwmgr.h"

Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/drm_atomic_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
#include <drm/drm_damage_helper.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
#ifdef __linux__
#include <drm/drm_gem_atomic_helper.h>
#endif
#include <drm/drm_plane_helper.h>
#include <drm/drm_print.h>
#include <drm/drm_self_refresh_helper.h>
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/drm_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_encoder.h>
#ifdef __linux__
#include <drm/drm_of.h>
#endif
#include <drm/drm_print.h>

#include "drm_crtc_internal.h"
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/drm_flip_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

#include <linux/slab.h>

#ifdef __FreeBSD__
#include <linux/list.h>
#endif

#include <drm/drm_flip_work.h>
#include <drm/drm_print.h>
#include <drm/drm_util.h>
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/drm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include <drm/drm_ioctl.h>
#include <drm/drm_vblank.h>

#ifdef __FreeBSD__
#include <drm/drm_file.h> /* Needed by the debugfs funcs */
#endif

#define DRM_IF_MAJOR 1
#define DRM_IF_MINOR 4

Expand Down
16 changes: 16 additions & 0 deletions drivers/gpu/drm/i915/display/intel_dmc_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/intel_fbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/display/intel_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -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);

Expand Down
5 changes: 0 additions & 5 deletions drivers/gpu/drm/i915/display/intel_hdcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
#include <linux/i2c.h>
#include <linux/random.h>

#ifdef __FreeBSD__
#include <linux/completion.h>
#include <linux/wait.h>
#endif

#include <drm/display/drm_hdcp_helper.h>
#include <drm/i915_component.h>

Expand Down
5 changes: 0 additions & 5 deletions drivers/gpu/drm/i915/gem/i915_gem_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
#include "i915_gem_lmem.h"
#include "i915_gem_mman.h"

#ifdef __FreeBSD__
#include <linux/xarray.h>
#include <linux/vmalloc.h>
#endif

#include "gt/intel_gt.h"

void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/gt/intel_ggtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
#include "intel_gtt.h"
#include "gen8_ppgtt.h"

#ifdef __FreeBSD__
#include <dev/agp/agpvar.h>
#endif

static void i915_ggtt_color_adjust(const struct drm_mm_node *node,
unsigned long color,
u64 *start,
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/gt/shmem_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#include <linux/pagemap.h>
#include <linux/shmem_fs.h>

#ifdef __FreeBSD__
#include <linux/file.h>
#endif

#include "gem/i915_gem_object.h"
#include "gem/i915_gem_lmem.h"
#include "shmem_utils.h"
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/i915_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) | \
Expand Down
23 changes: 0 additions & 23 deletions drivers/gpu/drm/i915/i915_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/i915_user_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

#include <uapi/drm/i915_drm.h>

#ifdef __FreeBSD__
#include <linux/workqueue.h> /* For struct delayed_work*/
#endif

#include "i915_user_extensions.h"
#include "i915_utils.h"

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/i915_vma_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#ifndef __I915_VMA_RESOURCE_H__
#define __I915_VMA_RESOURCE_H__

#ifdef __FreeBSD__
#include <linux/rbtree.h>
#endif

#include <linux/dma-fence.h>
#include <linux/refcount.h>

Expand Down
5 changes: 0 additions & 5 deletions drivers/gpu/drm/i915/intel_uncore.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/types.h>

#ifdef __FreeBSD__
#include <linux/kernel.h> /* For container_of */
#include <linux/io.h> /* For writeb/readb */
#endif

#include "i915_reg_defs.h"

struct drm_i915_private;
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/ttm/ttm_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@
#include <drm/ttm/ttm_caching.h>

#ifdef __FreeBSD__
#include <linux/completion.h>
#include <linux/wait.h>

#include <drm/ttm/ttm_sysctl_freebsd.h>

SYSCTL_NODE(_hw, OID_AUTO, ttm,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"TTM memory manager parameters");
Expand Down
1 change: 1 addition & 0 deletions include/drm/display/drm_dp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions include/drm/display/drm_dp_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <linux/delay.h>
#include <linux/i2c.h>

#include <drm/display/drm_dp.h>
#include <drm/drm_connector.h>

Expand Down
2 changes: 0 additions & 2 deletions include/drm/drm_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 0 additions & 4 deletions include/drm/drm_gem.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
#include <linux/kref.h>
#include <linux/dma-resv.h>

#ifdef __FreeBSD__
#include <linux/xarray.h>
#endif

#include <drm/drm_vma_manager.h>

struct iosys_map;
Expand Down
Empty file.
8 changes: 0 additions & 8 deletions include/drm/drm_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
};
Expand Down
Empty file added include/drm/drm_of.h
Empty file.
4 changes: 0 additions & 4 deletions include/drm/gpu_scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
#include <linux/xarray.h>
#include <linux/workqueue.h>

#ifdef __FreeBSD__
#include <linux/workqueue.h>
#endif

#define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000)

struct drm_gem_object;
Expand Down
1 change: 0 additions & 1 deletion include/drm/ttm/ttm_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <linux/types.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/atomic.h>
#include <linux/iosys-map.h>
#include <linux/dma-fence.h>

Expand Down

0 comments on commit ba6ae7b

Please sign in to comment.