Revert "pipe-loader: simplify pipe_loader_drm_probe"
This reverts commit a27ec5dc46
. It
breaks the intended behaviour of pipe_loader_probe() with ndev==0 as
relied upon by clover to query the number of devices available to the
pipe loader in the system.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
@@ -101,13 +101,12 @@ open_drm_render_node_minor(int minor)
|
|||||||
int
|
int
|
||||||
pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
|
pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
|
||||||
{
|
{
|
||||||
struct pipe_loader_device *dev;
|
|
||||||
int i, j, fd;
|
int i, j, fd;
|
||||||
|
|
||||||
for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
|
for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
|
||||||
i <= DRM_RENDER_NODE_MAX_MINOR && j < ndev; i++) {
|
i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
|
||||||
|
|
||||||
fd = open_drm_render_node_minor(i);
|
fd = open_drm_render_node_minor(i);
|
||||||
|
struct pipe_loader_device *dev;
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -116,7 +115,13 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
devs[j++] = dev;
|
if (j < ndev) {
|
||||||
|
devs[j] = dev;
|
||||||
|
} else {
|
||||||
|
close(fd);
|
||||||
|
dev->ops->release(&dev);
|
||||||
|
}
|
||||||
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return j;
|
return j;
|
||||||
|
Reference in New Issue
Block a user