File Index
Files and directories
Sign in
FILE

vbox_ttm.c

File preview with syntax highlighting.

linux-6.19.14/drivers/gpu/drm/vboxvideo/vbox_ttm.c C
 1// SPDX-License-Identifier: MIT
 2/*
 3 * Copyright (C) 2013-2017 Oracle Corporation
 4 * This file is based on ast_ttm.c
 5 * Copyright 2012 Red Hat Inc.
 6 * Authors: Dave Airlie <airlied@redhat.com>
 7 *          Michael Thayer <michael.thayer@oracle.com>
 8 */
 9#include <linux/pci.h>
10#include <drm/drm_file.h>
11#include <drm/drm_print.h>
12#include "vbox_drv.h"
13
14int vbox_mm_init(struct vbox_private *vbox)
15{
16	int ret;
17	resource_size_t base, size;
18	struct drm_device *dev = &vbox->ddev;
19	struct pci_dev *pdev = to_pci_dev(dev->dev);
20
21	base = pci_resource_start(pdev, 0);
22	size = pci_resource_len(pdev, 0);
23
24	/* Don't fail on errors, but performance might be reduced. */
25	devm_arch_phys_wc_add(&pdev->dev, base, size);
26
27	ret = drmm_vram_helper_init(dev, base, vbox->available_vram_size);
28	if (ret) {
29		DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
30		return ret;
31	}
32
33	return 0;
34}
~/ Read-only file preview.