summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-11-19 12:42:49 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-11-19 12:42:49 -0800
commitc67a83dfe1b60f81343ff7c2604a96b18ecb3b0c (patch)
tree1ea43084705d2c3555648bbbb5c3e77173f21703 /shared-core
parent60c1e3a09e33bfaec893c1d4780553b9b344293a (diff)
parente98eda91593b7c0a7494475be8cfd8cb4740f8ec (diff)
Merge branch 'modesetting-gem' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-gem
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/radeon_cs.c6
-rw-r--r--shared-core/radeon_drv.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/shared-core/radeon_cs.c b/shared-core/radeon_cs.c
index 56f6cbac..9227a011 100644
--- a/shared-core/radeon_cs.c
+++ b/shared-core/radeon_cs.c
@@ -41,21 +41,25 @@ int radeon_cs2_ioctl(struct drm_device *dev, void *data, struct drm_file *fpriv)
long size;
int r, i;
+ mutex_lock(&dev_priv->cs.cs_mutex);
/* set command stream id to 0 which is fake id */
cs_id = 0;
cs->cs_id = cs_id;
if (dev_priv == NULL) {
DRM_ERROR("called with no initialization\n");
+ mutex_unlock(&dev_priv->cs.cs_mutex);
return -EINVAL;
}
if (!cs->num_chunks) {
+ mutex_unlock(&dev_priv->cs.cs_mutex);
return 0;
}
chunk_array = drm_calloc(cs->num_chunks, sizeof(uint64_t), DRM_MEM_DRIVER);
if (!chunk_array) {
+ mutex_unlock(&dev_priv->cs.cs_mutex);
return -ENOMEM;
}
@@ -161,6 +165,7 @@ int radeon_cs2_ioctl(struct drm_device *dev, void *data, struct drm_file *fpriv)
out:
dev_priv->cs.ib_free(&parser);
+ mutex_unlock(&dev_priv->cs.cs_mutex);
for (i = 0; i < parser.num_chunks; i++) {
if (parser.chunks[i].kdata)
@@ -646,6 +651,7 @@ int radeon_cs_init(struct drm_device *dev)
{
drm_radeon_private_t *dev_priv = dev->dev_private;
+ mutex_init(&dev_priv->cs.cs_mutex);
if (dev_priv->chip_family < CHIP_RV280) {
dev_priv->cs.id_emit = r100_cs_id_emit;
dev_priv->cs.id_last_get = r100_cs_id_last_get;
diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h
index 50f0b171..a87e125c 100644
--- a/shared-core/radeon_drv.h
+++ b/shared-core/radeon_drv.h
@@ -316,6 +316,7 @@ struct drm_radeon_cs_parser {
/* command submission struct */
struct drm_radeon_cs_priv {
+ struct mutex cs_mutex;
uint32_t id_wcnt;
uint32_t id_scnt;
uint32_t id_last_wcnt;