2013-12-18 01:04:46 +08:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bochs.h"
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
int bochs_mm_init(struct bochs_device *bochs)
|
|
|
|
{
|
2019-05-08 16:26:23 +08:00
|
|
|
struct drm_vram_mm *vmm;
|
2013-12-18 01:04:46 +08:00
|
|
|
|
2019-05-08 16:26:23 +08:00
|
|
|
vmm = drm_vram_helper_alloc_mm(bochs->dev, bochs->fb_base,
|
|
|
|
bochs->fb_size,
|
|
|
|
&drm_gem_vram_mm_funcs);
|
2019-05-20 20:23:15 +08:00
|
|
|
return PTR_ERR_OR_ZERO(vmm);
|
2013-12-18 01:04:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void bochs_mm_fini(struct bochs_device *bochs)
|
|
|
|
{
|
2019-05-08 16:26:23 +08:00
|
|
|
if (!bochs->dev->vram_mm)
|
2013-12-18 01:04:46 +08:00
|
|
|
return;
|
|
|
|
|
2019-05-08 16:26:23 +08:00
|
|
|
drm_vram_helper_release_mm(bochs->dev);
|
2019-01-11 13:37:49 +08:00
|
|
|
}
|