aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_driver.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2006-12-08 03:01:33 +0000
committerBen Skeggs <[email protected]>2006-12-08 03:01:33 +0000
commit4cfb762c3eb2ea9a764c7ba0811c338ef5fba8fe (patch)
tree1fd9ce0a7a22e2bed4b4c83a374b78cf78c4b0f7 /src/mesa/drivers/dri/nouveau/nouveau_driver.c
parent3867bc97800ef3072a70565559c11badba3ed55a (diff)
Some work on buffer handling, most likely not entirely correct and
incomplete. But, it works well enough that windows can be moved/resized.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_driver.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_driver.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
index a45530e4511..f85dc62e748 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c
@@ -36,6 +36,35 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "utils.h"
+/* Wrapper for DRM_NOUVEAU_GETPARAM ioctl */
+GLboolean nouveauDRMGetParam(nouveauContextPtr nmesa,
+ unsigned int param,
+ uint64_t* value)
+{
+ drm_nouveau_getparam_t getp;
+
+ getp.param = param;
+ if (!value || drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_GETPARAM,
+ &getp, sizeof(getp)))
+ return GL_FALSE;
+ *value = getp.value;
+ return GL_TRUE;
+}
+
+/* Wrapper for DRM_NOUVEAU_GETPARAM ioctl */
+GLboolean nouveauDRMSetParam(nouveauContextPtr nmesa,
+ unsigned int param,
+ uint64_t value)
+{
+ drm_nouveau_setparam_t setp;
+
+ setp.param = param;
+ setp.value = value;
+ if (drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_SETPARAM, &setp,
+ sizeof(setp)))
+ return GL_FALSE;
+ return GL_TRUE;
+}
/* Return the width and height of the current color buffer */
static void nouveauGetBufferSize( GLframebuffer *buffer,