diff options
author | Eric Anholt <eric@anholt.net> | 2008-03-24 13:48:20 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-03-24 13:48:20 -0700 |
commit | c02ab432dd7058c700c35eecf6215daf5f262c51 (patch) | |
tree | bad1fe06e02db96d0850e6b20f0cf35041220d4f /src | |
parent | 552a1b824db31a234d7c5cb71057ed0e0ce64477 (diff) |
Revert "Use mprotect on unbound AGP memory to attempt to catch use while unbound."
While I still like the idea, the mprotect calls themselves are failing on
Linux and causing more trouble than they're worth.
This reverts commit a1612b7728d4153499fe86b6713a13c8702cc7d9.
Conflicts:
src/i830_driver.c
src/i830_memory.c
Diffstat (limited to 'src')
-rw-r--r-- | src/i830_driver.c | 10 | ||||
-rw-r--r-- | src/i830_memory.c | 17 |
2 files changed, 0 insertions, 27 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index c2ddf454..50d98088 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -171,7 +171,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include <unistd.h> #include <stdlib.h> #include <stdio.h> -#include <sys/mman.h> #include <errno.h> #include "xf86.h" @@ -697,15 +696,6 @@ I830MapMem(ScrnInfoPtr pScrn) pI830->FbBase + pI830->LpRing->mem->offset; } - /* Mark the pages we haven't yet bound into AGP as inaccessible. */ - if (pI830->FbMapSize > pI830->stolen_size) { - if (mprotect(pI830->FbBase + pI830->stolen_size, - pI830->FbMapSize - pI830->stolen_size, PROT_NONE) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to mprotect unbound AGP: %s\n", strerror(errno)); - } - } - return TRUE; } diff --git a/src/i830_memory.c b/src/i830_memory.c index 9e23c3ca..a38ee78b 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -101,7 +101,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <string.h> #include <errno.h> #include <sys/types.h> -#include <sys/mman.h> #include "xf86.h" #include "xf86_OSproc.h" @@ -204,31 +203,15 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem) mem->allocated_size, mem->tiling); } - /* Mark the pages accessible now that they're bound. */ - if (mprotect(pI830->FbBase + mem->offset, ALIGN(mem->size, GTT_PAGE_SIZE), - PROT_READ | PROT_WRITE) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to mprotect %s: %s\n", mem->name, strerror(errno)); - } - return TRUE; } static Bool i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem) { - I830Ptr pI830 = I830PTR(pScrn); - if (mem == NULL || !mem->bound) return TRUE; - /* Mark the pages accessible now that they're bound. */ - if (mprotect(pI830->FbBase + mem->offset, ALIGN(mem->size, GTT_PAGE_SIZE), - PROT_NONE) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to mprotect %s: %s\n", mem->name, strerror(errno)); - } - if (mem->tiling != TILE_NONE) i830_clear_tiling(pScrn, mem->fence_nr); |