xf86-video-intel: Branch 'xf86-video-intel-2.3-branch' - src/i830_driver.c src/i830_memory.c
Zhenyu Wang
zhen at kemper.freedesktop.org
Mon Mar 24 18:52:42 PDT 2008
src/i830_driver.c | 10 ----------
src/i830_memory.c | 17 -----------------
2 files changed, 27 deletions(-)
New commits:
commit 0af692e9ee5857e41ffdbaf760752a37737b21b7
Author: Eric Anholt <eric at anholt.net>
Date: Mon Mar 24 13:48:20 2008 -0700
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
(cherry picked from commit c02ab432dd7058c700c35eecf6215daf5f262c51)
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 98f4261..06edd3d 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 9e23c3c..a38ee78 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);
More information about the xorg-commit
mailing list