Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr fix drm pgattr #61

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions drivers/gpu/drm/xen/xen_drm_front_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,14 @@ static int gem_mmap_obj(struct xen_gem_object *xen_obj,
vma->vm_flags &= ~VM_PFNMAP;
vma->vm_flags |= VM_MIXEDMAP;
vma->vm_pgoff = 0;
vma->vm_page_prot =
pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
/*
* According to Xen on ARM ABI (xen/include/public/arch-arm.h):
* all memory which is shared with other entities in the system
* (including the hypervisor and other guests) must reside in memory
* which is mapped as Normal Inner Write-Back Outer Write-Back
* Inner-Shareable.
*/
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);

/*
* vm_operations_struct.fault handler will be called if CPU access
Expand Down Expand Up @@ -283,8 +289,9 @@ void *xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj)
if (!xen_obj->pages)
return NULL;

/* Please see comment in gem_mmap_obj on mapping and attributes. */
return vmap(xen_obj->pages, xen_obj->num_pages,
VM_MAP, pgprot_writecombine(PAGE_KERNEL));
VM_MAP, PAGE_KERNEL);
}

void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xen/xen_drm_front_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fb_create(struct drm_device *dev, struct drm_file *filp,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
struct xen_drm_front_drm_info *drm_info = dev->dev_private;
static struct drm_framebuffer *fb;
struct drm_framebuffer *fb;
struct drm_gem_object *gem_obj;
int ret;

Expand Down