Skip to content

Commit

Permalink
[wip] Initialize intel_graphics_stolen_res synchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell committed Mar 17, 2023
1 parent d06d945 commit da06239
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
6 changes: 0 additions & 6 deletions drivers/gpu/drm/i915/gem/i915_gem_stolen.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,6 @@ static int i915_gem_init_stolen(struct intel_memory_region *mem)
return 0;
}

#ifdef __FreeBSD__
DRM_INFO("Got stolen memory base 0x%x, size 0x%x\n",
intel_graphics_stolen_res.start,
resource_size(&intel_graphics_stolen_res));
#endif

if (resource_size(&mem->region) == 0)
return 0;

Expand Down
11 changes: 11 additions & 0 deletions drivers/gpu/drm/i915/i915_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ static int __init i915_init(void)
{
int err, i;

#ifdef __FreeBSD__
#if defined(__amd64__)
intel_graphics_stolen_res = (struct linux_resource)
DEFINE_RES_MEM(intel_graphics_stolen_base,
intel_graphics_stolen_size);
DRM_INFO("Got Intel graphics stolen memory base 0x%x, size 0x%x\n",
intel_graphics_stolen_res.start,
resource_size(&intel_graphics_stolen_res));
#endif
#endif

for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
err = init_funcs[i].init();
if (err < 0) {
Expand Down
12 changes: 0 additions & 12 deletions drivers/gpu/drm/i915/intel_freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,3 @@ linux_intel_gtt_insert_sg_entries(struct sg_table *st, unsigned int pg_start,

intel_gtt_read_pte(pg_start + i - 1);
}

#if defined(__amd64__)
static void
intel_freebsd_init(void *arg __unused)
{
/* Defined in $SYSDIR/x86/pci/pci_early_quirks.c */
intel_graphics_stolen_res = (struct linux_resource)
DEFINE_RES_MEM(intel_graphics_stolen_base,
intel_graphics_stolen_size);
}
SYSINIT(intel_freebsd, SI_SUB_DRIVERS, SI_ORDER_ANY, intel_freebsd_init, NULL);
#endif

0 comments on commit da06239

Please sign in to comment.