Skip to contentSkip to conversation

etnaviv: fix etna_bo_from_name

PATCH Superseded Philipp Zabel 2 participants 3 messages Aug 4, 2017 – Aug 5, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 etnaviv: fix etna_bo_from_name

Look up BOs from the name table using the name parameter instead of req.handle (which at this point is always zero).

---
Sorry for the resend, this time to the correct list.

---
 etnaviv/etnaviv_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
etnaviv/etnaviv_bo.c +1 -1
index 4ad0434e..4fe877f1 100644
@@ -173,7 +173,7 @@ struct etna_bo *etna_bo_from_name(struct etna_device *dev, uint32_t name)
 	pthread_mutex_lock(&table_lock);
 
 	/* check name table first, to see if bo is already open: */
-	bo = lookup_bo(dev->name_table, req.handle);
+	bo = lookup_bo(dev->name_table, name);
 	if (bo)
 		goto out_unlock;
 
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 etnaviv: add etna_bo_from_handle

Although etnaviv_drmif.h declared etna_bo_from_handle from the start, there was no implementation.

---
 etnaviv/etnaviv_bo.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
etnaviv/etnaviv_bo.c +19 -0
index 4fe877f1..75669572 100644
@@ -135,6 +135,25 @@ struct etna_bo *etna_bo_new(struct etna_device *dev, uint32_t size,
 	return bo;
 }
 
+struct etna_bo *
+etna_bo_from_handle(struct etna_device *dev, uint32_t handle, uint32_t size)
+{
+	struct etna_bo *bo = NULL;
+
+	pthread_mutex_lock(&table_lock);
+
+	bo = lookup_bo(dev->handle_table, handle);
+	if (bo)
+		goto out_unlock;
+
+	bo = bo_from_handle(dev, size, handle, 0);
+
+out_unlock:
+	pthread_mutex_unlock(&table_lock);
+
+	return bo;
+}
+
 struct etna_bo *etna_bo_ref(struct etna_bo *bo)
 {
 	atomic_inc(&bo->refcnt);
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/2
#2 lore raw
In reply to Philipp Zabel

2017-08-04 17:28 GMT+02:00 Philipp Zabel <[email protected]>:

Quoted 5 lines

Look up BOs from the name table using the name parameter instead of req.handle (which at this point is always zero).

Quoted 22 lines

---
Sorry for the resend, this time to the correct list.

---
 etnaviv/etnaviv_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
etnaviv/etnaviv_bo.c +1 -2
index 4ad0434e..4fe877f1 100644
@@ -173,7 +173,7 @@ struct etna_bo *etna_bo_from_name(struct etna_device *dev, uint32_t name)
        pthread_mutex_lock(&table_lock);
 
        /* check name table first, to see if bo is already open: */
-       bo = lookup_bo(dev->name_table, req.handle);
+       bo = lookup_bo(dev->name_table, name);
        if (bo)
                goto out_unlock;
 
--

2.11.0

Quoted 4 lines

_______________________________________________
etnaviv mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/etnaviv

greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel