Changeset View
Standalone View
x11/nvidia-driver/files/extra-patch-src_nvidia-modeset_nvidia-modeset-freebsd.c
- This file was added.
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
--- src/nvidia-modeset/nvidia-modeset-freebsd.c.orig 2016-05-28 15:44:11 UTC | |||||
+++ src/nvidia-modeset/nvidia-modeset-freebsd.c | |||||
@@ -245,7 +245,7 @@ struct nvkms_ref_ptr { | |||||
struct nvkms_ref_ptr* NVKMS_API_CALL nvkms_alloc_ref_ptr(void *ptr) | |||||
{ | |||||
- struct nvkms_ref_ptr *ref_ptr = nvkms_alloc(sizeof(*ref_ptr), NV_FALSE); | |||||
+ struct nvkms_ref_ptr *ref_ptr = nvkms_alloc(sizeof(*ref_ptr), NV_TRUE); | |||||
if (ref_ptr) { | |||||
danfe: Can we add a comment about why this change (and similar one below) is required? Is it related… | |||||
Not Done Inline ActionsYes, the patch comes from comment #50-51 in the bug. I am guessing that the true/false parameter to nvkms_alloc() specifies whether to M_ZERO or not. Are you looking for a comment in the patch itself, or in the Makefile where the patch is applied? Thanks. Maybe it would also be fine to mtx_init() with MTX_NEW instead, but I don't think there is a good reason to make that change at this time. cem: Yes, the patch comes from comment #50-51 in the bug. I am guessing that the true/false… | |||||
Not Done Inline ActionsI provided this patch. Yes, it is in comment #49. The "acquiring duplicate lock" message however turned out to be benign. The allocated memory has to be initialised to zero, otherwise lock_initialized() can blow up when it looks into the allocated memory to check if the lock already is initialized. lock_initialized() is called from mtx_init() via lock_init(). These functions are in sys/kern/kern_mutex.c and subr_lock.c. (I don't find MTX_NEW in 10.3 - is this new in 11?) bengta_sics.se: I provided this patch. Yes, it is in comment #49. The "acquiring duplicate lock" message… | |||||
Not Done Inline ActionsYeah, I guess MTX_NEW is new in 11 (although it's now 20 months old!): https://svnweb.freebsd.org/base?view=revision&revision=275751 It looks like it wasn't MFCed: http://fxr.watson.org/fxr/trackident?i=MTX_NEW cem: Yeah, I guess MTX_NEW is new in 11 (although it's now 20 months old!): https://svnweb.freebsd. | |||||
mtx_init(&ref_ptr->lock, "nvkms-ref-ptr-lock", NULL, MTX_SPIN); | |||||
// The ref_ptr owner counts as a reference on the ref_ptr itself. | |||||
@@ -792,7 +792,7 @@ static int nvkms_open( | |||||
nvkms_module.client_counter += 1; | |||||
sx_xunlock(&nvkms_module.lock); | |||||
- popen = nvkms_alloc(sizeof(*popen), NV_FALSE); | |||||
+ popen = nvkms_alloc(sizeof(*popen), NV_TRUE); | |||||
if (popen == NULL) { | |||||
return ENOMEM; | |||||
} |
Can we add a comment about why this change (and similar one below) is required? Is it related to the reported panic due to "acquiring duplicate lock" reported here?