Skip to content

Commit 778e73d

Browse files
Thomas Zimmermannhdeller
authored andcommitted
drm/hyperv: Remove firmware framebuffers with aperture helper
Replace use of screen_info state with the correct interface from the aperture helpers. The state is only for architecture and firmware code. It is not guaranteed to contain valid data. Drivers are thus not allowed to use it. For removing conflicting firmware framebuffers, there are aperture helpers. Hence replace screen_info with the correct function that will remove conflicting framebuffers for the hyperv-drm driver. Also move the call to the correct place within the driver. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 7452b31 commit 778e73d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/gpu/drm/hyperv/hyperv_drm_drv.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <linux/hyperv.h>
88
#include <linux/module.h>
99
#include <linux/pci.h>
10-
#include <linux/screen_info.h>
1110

1211
#include <drm/drm_aperture.h>
1312
#include <drm/drm_atomic_helper.h>
@@ -73,11 +72,6 @@ static int hyperv_setup_vram(struct hyperv_drm_device *hv,
7372
struct drm_device *dev = &hv->dev;
7473
int ret;
7574

76-
if (IS_ENABLED(CONFIG_SYSFB))
77-
drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base,
78-
screen_info.lfb_size,
79-
&hyperv_driver);
80-
8175
hv->fb_size = (unsigned long)hv->mmio_megabytes * 1024 * 1024;
8276

8377
ret = vmbus_allocate_mmio(&hv->mem, hdev, 0, -1, hv->fb_size, 0x100000,
@@ -130,6 +124,8 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
130124
goto err_hv_set_drv_data;
131125
}
132126

127+
drm_aperture_remove_framebuffers(&hyperv_driver);
128+
133129
ret = hyperv_setup_vram(hv, hdev);
134130
if (ret)
135131
goto err_vmbus_close;

0 commit comments

Comments
 (0)