[Mesa-dev] [PATCH 10/13] pipe-loader: introduce pipe_loader_sw_probe_null helper function

Emil Velikov emil.l.velikov at gmail.com
Mon Feb 10 20:26:30 PST 2014


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/auxiliary/pipe-loader/pipe_loader.h    | 10 ++++++++++
 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 18 +++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index f5a7252..026f809 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -133,6 +133,16 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device **devs,
 
 
 /**
+ * Initialize a null sw device.
+ *
+ * This function is platform-specific.
+ *
+ * \sa pipe_loader_probe
+ */
+bool
+pipe_loader_sw_probe_null(struct pipe_loader_device **devs);
+
+/**
  * Get a list of known software devices.
  *
  * This function is platform-specific.
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 954e16e..618a911 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -85,7 +85,23 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_f
    return true;
 }
 
-int
+bool
+pipe_loader_sw_probe_null(struct pipe_loader_device **devs)
+{
+   struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device);
+
+   if (!sdev)
+      return false;
+
+   sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE;
+   sdev->base.driver_name = "swrast";
+   sdev->base.ops = &pipe_loader_sw_ops;
+   sdev->ws = null_sw_create();
+   *devs = &sdev->base;
+
+   return true;
+}
+
 pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev)
 {
    int i;
-- 
1.8.5.4



More information about the mesa-dev mailing list