summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c60
1 files changed, 1 insertions, 59 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index ffeb29906b5..009e1dfdf6f 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -169,14 +169,6 @@ pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd,
}
static int
-open_drm_minor(int minor)
-{
- char path[PATH_MAX];
- snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
- return open(path, O_RDWR, 0);
-}
-
-static int
open_drm_render_node_minor(int minor)
{
char path[PATH_MAX];
@@ -188,15 +180,8 @@ open_drm_render_node_minor(int minor)
int
pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
{
- int i, k, fd, num_render_node_devs;
- int j = 0;
+ int i, j, fd;
- struct {
- unsigned vendor_id;
- unsigned chip_id;
- } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
-
- /* Look for render nodes first */
for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
fd = open_drm_render_node_minor(i);
@@ -209,9 +194,6 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
continue;
}
- render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
- render_node_devs[j].chip_id = dev->u.pci.chip_id;
-
if (j < ndev) {
devs[j] = dev;
} else {
@@ -221,46 +203,6 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
j++;
}
- num_render_node_devs = j;
-
- /* Next look for drm devices. */
- for (i = 0; i < DRM_MAX_MINOR; i++) {
- struct pipe_loader_device *dev;
- boolean duplicate = FALSE;
- fd = open_drm_minor(i);
- if (fd < 0)
- continue;
-
- if (!pipe_loader_drm_probe_fd(&dev, fd, true)) {
- close(fd);
- continue;
- }
-
- /* Check to make sure we aren't already accessing this device via
- * render nodes.
- */
- for (k = 0; k < num_render_node_devs; k++) {
- if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
- dev->u.pci.chip_id == render_node_devs[k].chip_id) {
- close(fd);
- dev->ops->release(&dev);
- duplicate = TRUE;
- break;
- }
- }
-
- if (duplicate)
- continue;
-
- if (j < ndev) {
- devs[j] = dev;
- } else {
- dev->ops->release(&dev);
- }
-
- j++;
- }
-
return j;
}