drm/i915/fbdev: Fix smem_start for LMEMBAR stolen objects
authorjsg <jsg@openbsd.org>
Tue, 13 Aug 2024 00:23:25 +0000 (00:23 +0000)
committerjsg <jsg@openbsd.org>
Tue, 13 Aug 2024 00:23:25 +0000 (00:23 +0000)
From Ville Syrjala
f1ee98cff3d86271491b08315fcdfa4c3f097e1e in mainline linux

sys/dev/pci/drm/i915/display/intel_fbdev.c

index 63f6bba..53c4282 100644 (file)
@@ -295,7 +295,8 @@ static int intelfb_create(struct drm_fb_helper *helper,
                /* Use fbdev's framebuffer from lmem for discrete */
                info->fix.smem_start =
                        (unsigned long)(mem->io.start +
-                                       i915_gem_object_get_dma_address(obj, 0));
+                                       i915_gem_object_get_dma_address(obj, 0) -
+                                       mem->region.start);
                info->fix.smem_len = obj->base.size;
        } else {
                /* Our framebuffer is the entirety of fbdev's system memory */