2019-05-27 06:55:01 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2013-12-17 17:04:46 +00:00
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bochs.h"
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
int bochs_mm_init(struct bochs_device *bochs)
|
|
|
|
{
|
2019-05-08 08:26:23 +00:00
|
|
|
struct drm_vram_mm *vmm;
|
2013-12-17 17:04:46 +00:00
|
|
|
|
2019-05-08 08:26:23 +00:00
|
|
|
vmm = drm_vram_helper_alloc_mm(bochs->dev, bochs->fb_base,
|
|
|
|
bochs->fb_size,
|
|
|
|
&drm_gem_vram_mm_funcs);
|
2019-05-20 12:23:15 +00:00
|
|
|
return PTR_ERR_OR_ZERO(vmm);
|
2013-12-17 17:04:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void bochs_mm_fini(struct bochs_device *bochs)
|
|
|
|
{
|
2019-05-08 08:26:23 +00:00
|
|
|
if (!bochs->dev->vram_mm)
|
2013-12-17 17:04:46 +00:00
|
|
|
return;
|
|
|
|
|
2019-05-08 08:26:23 +00:00
|
|
|
drm_vram_helper_release_mm(bochs->dev);
|
2019-01-11 05:37:49 +00:00
|
|
|
}
|