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