Skip to content

Commit 9f6a07b

Browse files
committed
drm/i915 (FreeBSD): Use info->fix.smem_* to register fictitious mem range
[Why] When the code was adapted to use the new vt_drmfb integration, the i915 driver continued to use the values that used to be stored in `info->apertures->ranges[0]`. However they might be incorrect and in fact zero. [How] Instead, use the `info->fix.smem_*` values to register the fictitious range. These are the values by vt_drmfb later.
1 parent 43f5295 commit 9f6a07b

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

drivers/gpu/drm/i915/display/intel_fbdev.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -288,22 +288,12 @@ static int intelfb_create(struct drm_fb_helper *helper,
288288
if (i915_gem_object_is_lmem(obj)) {
289289
struct intel_memory_region *mem = obj->mm.region;
290290

291-
#ifdef __FreeBSD__
292-
info->aperture_base = mem->io_start;
293-
info->aperture_size = mem->io_size;
294-
#endif
295-
296291
/* Use fbdev's framebuffer from lmem for discrete */
297292
info->fix.smem_start =
298293
(unsigned long)(mem->io_start +
299294
i915_gem_object_get_dma_address(obj, 0));
300295
info->fix.smem_len = obj->base.size;
301296
} else {
302-
#ifdef __FreeBSD__
303-
info->aperture_base = ggtt->gmadr.start;
304-
info->aperture_size = ggtt->mappable_end;
305-
#endif
306-
307297
/* Our framebuffer is the entirety of fbdev's system memory */
308298
info->fix.smem_start =
309299
(unsigned long)(ggtt->gmadr.start + i915_ggtt_offset(vma));
@@ -313,18 +303,18 @@ static int intelfb_create(struct drm_fb_helper *helper,
313303
#ifdef __FreeBSD__
314304
/*
315305
* After the if() above, we can register the fictitious memory range
316-
* based on the info->apertures->ranges[0] values.
306+
* based on the info->fix.smem_* values.
317307
*
318-
* This was handled in register_framebuffer() in the past, also based
319-
* on the values of info->apertures->ranges[0]. However, the `amdgpu`
308+
* This was handled in register_framebuffer() in the past, but based on
309+
* the values of info->apertures->ranges[0]. However, the `amdgpu`
320310
* driver stopped setting them when it got rid of its specific
321311
* framebuffer initialization to use the generic drm_fb_helper code.
322312
*
323313
* We can't do this in register_framebuffer() anymore because the
324314
* values passed to register_fictitious_range() below are unavailable
325315
* from a generic structure set by both drivers.
326316
*/
327-
register_fictitious_range(info->aperture_base, info->aperture_size);
317+
register_fictitious_range(info->fix.smem_start, info->fix.smem_len);
328318
#endif
329319

330320
for_i915_gem_ww(&ww, ret, false) {
@@ -401,8 +391,8 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
401391

402392
#ifdef __FreeBSD__
403393
unregister_fictitious_range(
404-
ifbdev->helper.info->aperture_base,
405-
ifbdev->helper.info->aperture_size);
394+
ifbdev->helper.info->fix.smem_start,
395+
ifbdev->helper.info->fix.smem_len);
406396
#endif
407397

408398
drm_fb_helper_fini(&ifbdev->helper);

linuxkpi/gplv2/include/linux/fb.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ struct linux_fb_info {
149149
struct fb_info fbio;
150150
device_t fb_bsddev;
151151
struct task fb_mode_task;
152-
153-
/* i915 fictitious pages area */
154-
resource_size_t aperture_base;
155-
resource_size_t aperture_size;
156152
#endif
157153
} __aligned(sizeof(long));
158154

0 commit comments

Comments
 (0)