rpms/xorg-x11-drv-ati/F-10 radeon-modeset.patch, 1.32, 1.33 xorg-x11-drv-ati.spec, 1.143, 1.144
Dave Airlie
airlied at fedoraproject.org
Mon Nov 10 05:06:39 UTC 2008
Author: airlied
Update of /cvs/pkgs/rpms/xorg-x11-drv-ati/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26845
Modified Files:
radeon-modeset.patch xorg-x11-drv-ati.spec
Log Message:
- fix rendering from very large pixmaps (#468571)
radeon-modeset.patch:
Index: radeon-modeset.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-ati/F-10/radeon-modeset.patch,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- radeon-modeset.patch 10 Nov 2008 01:28:34 -0000 1.32
+++ radeon-modeset.patch 10 Nov 2008 05:06:38 -0000 1.33
@@ -1,3 +1,15 @@
+commit a9bd6835e8f41a1ceb2a62bd1c4a8f92051cb620
+Author: Dave Airlie <airlied at redhat.com>
+Date: Mon Nov 10 14:18:17 2008 +1000
+
+ radeon: add more buffer info + fix read objects too big fallback
+
+commit 115015f904e21c9118982b4b8be6e420a72fb334
+Author: Dave Airlie <airlied at redhat.com>
+Date: Mon Nov 10 11:47:02 2008 +1000
+
+ radeon: remove old exa bufmgr not used anymore code
+
commit 8883244a965896052de172aec3c4aea97adb6731
Author: Dave Airlie <airlied at redhat.com>
Date: Mon Nov 10 11:18:27 2008 +1000
@@ -648,7 +660,7 @@
save_CFLAGS="$CFLAGS"
diff --git a/src/Makefile.am b/src/Makefile.am
-index d65a3e4..ff54329 100644
+index d65a3e4..1be325a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -90,12 +90,13 @@ radeon_drv_ladir = @moduledir@/drivers
@@ -663,7 +675,7 @@
$(RADEON_ATOMBIOS_SOURCES) radeon_atombios.c radeon_atomwrapper.c \
- $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) atombios_output.c atombios_crtc.c
+ $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) atombios_output.c atombios_crtc.c \
-+ drmmode_display.c radeon_bufmgr_exa.c radeon_bufmgr_gem.c radeon_dri_bufmgr.c
++ drmmode_display.c radeon_bufmgr_gem.c radeon_dri_bufmgr.c
if XMODES
radeon_drv_la_SOURCES += \
@@ -2238,10 +2250,10 @@
Bool
diff --git a/src/radeon_bufmgr.h b/src/radeon_bufmgr.h
new file mode 100644
-index 0000000..5d45aa5
+index 0000000..481c5cf
--- /dev/null
+++ b/src/radeon_bufmgr.h
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,25 @@
+/**
+ * @file intel_bufmgr.h
+ *
@@ -2265,371 +2277,14 @@
+
+void radeon_bufmgr_emit_reloc(dri_bo *buf, struct radeon_relocs_info *relocs, uint32_t *head, uint32_t *count_p, uint32_t read_domains, uint32_t write_domain);
+
-+dri_bufmgr *radeon_bufmgr_exa_init(ScrnInfoPtr pScrn);
-+extern void radeon_bufmgr_exa_wait_rendering(dri_bo *bo);
-+extern dri_bo *radeon_bufmgr_exa_create_bo(dri_bufmgr *bufmgr, struct radeon_memory *mem);
+void radeon_bufmgr_post_submit(dri_bufmgr *bufmgr);
+#endif
-diff --git a/src/radeon_bufmgr_exa.c b/src/radeon_bufmgr_exa.c
-new file mode 100644
-index 0000000..0f493a5
---- /dev/null
-+++ b/src/radeon_bufmgr_exa.c
-@@ -0,0 +1,328 @@
-+/**************************************************************************
-+ *
-+ * Copyright © 2007-2008 Red Hat Inc.
-+ * Copyright © 2007 Intel Corporation
-+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
-+ * All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the
-+ * "Software"), to deal in the Software without restriction, including
-+ * without limitation the rights to use, copy, modify, merge, publish,
-+ * distribute, sub license, and/or sell copies of the Software, and to
-+ * permit persons to whom the Software is furnished to do so, subject to
-+ * the following conditions:
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
-+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ *
-+ * The above copyright notice and this permission notice (including the
-+ * next paragraph) shall be included in all copies or substantial portions
-+ * of the Software.
-+ *
-+ *
-+ **************************************************************************/
-+/*
-+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
-+ * Keith Whitwell <keithw-at-tungstengraphics-dot-com>
-+ * Eric Anholt <eric at anholt.net>
-+ * Dave Airlie <airlied at linux.ie>
-+ * Kristian Høgsberg <krh at redhat.com>
-+ */
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include <xf86drm.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <assert.h>
-+
-+#include "xf86.h"
-+#include "errno.h"
-+#include "string.h"
-+
-+#include "radeon_reg.h"
-+#include "radeon_probe.h"
-+#include "radeon.h"
-+#include "radeon_bufmgr.h"
-+#include "radeon_drm.h"
-+
-+
-+typedef struct _dri_bo_exa {
-+ dri_bo bo;
-+ struct radeon_memory *mem;
-+ int refcount;
-+ int reloc_count;
-+ int map_count;
-+ /* reloc list - add to list for relocs */
-+ struct _dri_bo_exa *next;
-+} dri_bo_exa;
-+
-+typedef struct _dri_bufmgr_exa {
-+ dri_bufmgr bufmgr;
-+ struct radeon_bufmgr radeon_bufmgr;
-+ ScrnInfoPtr pScrn;
-+ struct _dri_bo_exa *reloc_head;
-+} dri_bufmgr_exa;
-+
-+static dri_bo *
-+dri_exa_alloc(dri_bufmgr *bufmgr, const char *name,
-+ unsigned long size, unsigned int alignment, uint64_t location_mask)
-+
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)bufmgr;
-+ RADEONInfoPtr info = RADEONPTR(bufmgr_exa->pScrn);
-+ dri_bo_exa *exa_buf;
-+
-+ exa_buf = malloc(sizeof(*exa_buf));
-+ if (!exa_buf)
-+ return NULL;
-+
-+ exa_buf->refcount = 1;
-+ exa_buf->mem = radeon_allocate_memory(bufmgr_exa->pScrn, RADEON_POOL_GART,
-+ size, alignment, 0, name, 0);
-+
-+ exa_buf->bo.size = exa_buf->mem->size;
-+ exa_buf->bo.offset = exa_buf->mem->offset;
-+ exa_buf->bo.bufmgr = bufmgr;
-+ exa_buf->next = NULL;
-+ exa_buf->reloc_count = 0;
-+ exa_buf->map_count = 0;
-+
-+ return &exa_buf->bo;
-+}
-+
-+static void
-+dri_exa_bo_reference(dri_bo *buf)
-+{
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+ exa_buf->refcount++;
-+}
-+
-+static void
-+dri_exa_bo_unreference(dri_bo *buf)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+
-+ if (!buf)
-+ return;
-+
-+ if (--exa_buf->refcount == 0)
-+ radeon_free_memory(bufmgr_exa->pScrn, exa_buf->mem);
-+}
-+
-+static int
-+dri_exa_bo_map(dri_bo *buf, int write_enable)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+
-+ if (exa_buf->map_count++ != 0)
-+ return 0;
-+
-+ radeon_map_memory(bufmgr_exa->pScrn, exa_buf->mem);
-+ exa_buf->bo.virtual = exa_buf->mem->map;
-+ return 0;
-+}
-+
-+static int
-+dri_exa_bo_unmap(dri_bo *buf)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+
-+ if (--exa_buf->map_count > 0)
-+ return 0;
-+
-+ radeon_unmap_memory(bufmgr_exa->pScrn, exa_buf->mem);
-+ exa_buf->bo.virtual = 0;
-+ return 0;
-+}
-+
-+static void
-+dri_bufmgr_exa_destroy(dri_bufmgr *bufmgr)
-+{
-+ free(bufmgr);
-+}
-+
-+void radeon_bufmgr_exa_wait_rendering(dri_bo *buf)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ RADEONInfoPtr info = RADEONPTR(bufmgr_exa->pScrn);
-+ struct drm_radeon_gem_set_domain dom_args;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+ int ret;
-+
-+ dom_args.handle = exa_buf->mem->kernel_bo_handle;
-+ dom_args.read_domains = RADEON_GEM_DOMAIN_GTT;
-+ dom_args.write_domain = 0;
-+ ret = drmCommandWriteRead(info->dri->drmFD, DRM_RADEON_GEM_SET_DOMAIN,
-+ &dom_args, sizeof(dom_args));
-+
-+ return;
-+}
-+
-+int radeon_bufmgr_subdata(dri_bo *buf, unsigned long offset,
-+ unsigned long size, const void *data)
-+{
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ RADEONInfoPtr info = RADEONPTR(bufmgr_exa->pScrn);
-+ int ret;
-+ /* go to pwrite */
-+ struct drm_radeon_gem_pwrite pwrite;
-+
-+ pwrite.handle = exa_buf->mem->kernel_bo_handle;
-+ pwrite.offset = offset;
-+ pwrite.size = size;
-+ pwrite.data_ptr = (uint64_t)(uintptr_t)data;
-+
-+ do {
-+ ret = drmCommandWriteRead(info->dri->drmFD, DRM_IOCTL_RADEON_GEM_PWRITE,
-+ &pwrite, sizeof(pwrite));
-+ } while (ret == -1 && errno == EINTR);
-+
-+ if (ret != 0) {
-+ fprintf(stderr,"Pwrite %lx at %lx failed\n", size, offset);
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+
-+dri_bo *
-+radeon_bufmgr_exa_create_bo(dri_bufmgr *bufmgr, struct radeon_memory *mem)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)bufmgr;
-+ dri_bo_exa *exa_buf;
-+
-+ exa_buf = malloc(sizeof(*exa_buf));
-+ if (!exa_buf)
-+ return NULL;
-+ exa_buf->refcount = 1;
-+ exa_buf->mem = mem;
-+ exa_buf->bo.size = exa_buf->mem->size;
-+ exa_buf->bo.offset = exa_buf->mem->offset;
-+ exa_buf->bo.bufmgr = bufmgr;
-+ exa_buf->bo.virtual = exa_buf->mem->map;
-+ exa_buf->next = NULL;
-+ exa_buf->reloc_count = 0;
-+ /* get map count right */
-+ exa_buf->map_count = 1;
-+
-+ return &exa_buf->bo;
-+}
-+
-+static void radeon_bufmgr_exa_emit_reloc(dri_bo *buf, uint32_t *head, uint32_t *count_p, uint32_t read_domains, uint32_t write_domain)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ ScrnInfoPtr pScrn = bufmgr_exa->pScrn;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+ uint32_t *__head = head;
-+ uint32_t __count = *count_p;
-+ dri_bo_exa *trav;
-+
-+ if (exa_buf->reloc_count == 0) {
-+ dri_bo_reference(buf);
-+
-+ if (bufmgr_exa->reloc_head == NULL)
-+ bufmgr_exa->reloc_head = exa_buf;
-+ else {
-+ trav = bufmgr_exa->reloc_head;
-+ while (trav->next != NULL)
-+ trav = trav->next;
-+ trav->next = exa_buf;
-+ }
-+ }
-+ exa_buf->reloc_count++;
-+ OUT_RING(CP_PACKET3(RADEON_CP_PACKET3_NOP, 2));
-+ OUT_RING(exa_buf->mem->kernel_bo_handle);
-+ OUT_RING(read_domains);
-+ OUT_RING(write_domain);
-+ *count_p = __count;
-+}
-+
-+static int radeon_bufmgr_exa_pin(dri_bo *buf)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+
-+ return !radeon_bind_memory(bufmgr_exa->pScrn, exa_buf->mem);
-+}
-+
-+static void radeon_bufmgr_exa_unpin(dri_bo *buf)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)buf->bufmgr;
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+
-+ radeon_unbind_memory(bufmgr_exa->pScrn, exa_buf->mem);
-+}
-+
-+static uint32_t radeon_bufmgr_get_handle(dri_bo *buf)
-+{
-+ dri_bo_exa *exa_buf = (dri_bo_exa *)buf;
-+
-+ return exa_buf->mem->kernel_bo_handle;
-+}
-+
-+
-+/**
-+ * Initializes the EXA buffer manager, which is just a thin wrapper
-+ * around the EXA allocator.
-+ *
-+ * \param fd File descriptor of the opened DRM device.
-+ * \param fence_type Driver-specific fence type used for fences with no flush.
-+ * \param fence_type_flush Driver-specific fence type used for fences with a
-+ * flush.
-+ */
-+dri_bufmgr *
-+radeon_bufmgr_exa_init(ScrnInfoPtr pScrn)
-+{
-+ dri_bufmgr_exa *bufmgr_exa;
-+
-+ bufmgr_exa = calloc(1, sizeof(*bufmgr_exa));
-+ bufmgr_exa->pScrn = pScrn;
-+
-+ bufmgr_exa->bufmgr.bo_alloc = dri_exa_alloc;
-+ bufmgr_exa->bufmgr.bo_reference = dri_exa_bo_reference;
-+ bufmgr_exa->bufmgr.bo_unreference = dri_exa_bo_unreference;
-+ bufmgr_exa->bufmgr.bo_map = dri_exa_bo_map;
-+ bufmgr_exa->bufmgr.bo_unmap = dri_exa_bo_unmap;
-+ bufmgr_exa->bufmgr.destroy = dri_bufmgr_exa_destroy;
-+ //bufmgr_exa->bufmgr.bo_wait_rendering = radeon_bufmgr_exa_wait_rendering;
-+ bufmgr_exa->radeon_bufmgr.emit_reloc = radeon_bufmgr_exa_emit_reloc;
-+ bufmgr_exa->bufmgr.pin = radeon_bufmgr_exa_pin;
-+ bufmgr_exa->bufmgr.unpin = radeon_bufmgr_exa_unpin;
-+ bufmgr_exa->bufmgr.get_handle = radeon_bufmgr_get_handle;
-+ return &bufmgr_exa->bufmgr;
-+}
-+
-+void radeon_bufmgr_post_submit(dri_bufmgr *bufmgr)
-+{
-+ dri_bufmgr_exa *bufmgr_exa = (dri_bufmgr_exa *)bufmgr;
-+ struct _dri_bo_exa *trav, *prev;
-+
-+ if (!bufmgr_exa->reloc_head)
-+ return;
-+
-+ trav = bufmgr_exa->reloc_head;
-+ while (trav) {
-+ prev = trav;
-+ trav = trav->next;
-+
-+ prev->reloc_count = 0;
-+ prev->next = NULL;
-+ dri_bo_unreference(&prev->bo);
-+ }
-+ bufmgr_exa->reloc_head = NULL;
-+
-+}
-diff --git a/src/radeon_bufmgr_exa.h b/src/radeon_bufmgr_exa.h
-new file mode 100644
-index 0000000..0d79b58
---- /dev/null
-+++ b/src/radeon_bufmgr_exa.h
-@@ -0,0 +1,14 @@
-+#ifndef RADEON_BUFMGR_EXA_H
-+#define RADEON_BUFMGR_EXA_H
-+
-+#include "radeon_dri_bufmgr.h"
-+
-+dri_bufmgr *radeon_bufmgr_exa_init(ScrnInfoPtr pScrn);
-+extern void radeon_bufmgr_exa_wait_rendering(dri_bo *bo);
-+extern dri_bo *radeon_bufmgr_exa_create_bo(dri_bufmgr *bufmgr, struct radeon_memory *mem);
-+void radeon_bufmgr_exa_emit_reloc(dri_bo *bo, uint32_t *head, uint32_t *count_p, uint32_t read_domains, uint32_t write_domain);
-+void radeon_bufmgr_post_submit(dri_bufmgr *bufmgr);
-+void radeon_bufmgr_pin(dri_bo *buf);
-+void radeon_bufmgr_unpin(dri_bo *buf);
-+uint32_t radeon_bufmgr_get_handle(dri_bo *buf);
-+#endif
diff --git a/src/radeon_bufmgr_gem.c b/src/radeon_bufmgr_gem.c
new file mode 100644
-index 0000000..684491f
+index 0000000..a8bc465
--- /dev/null
+++ b/src/radeon_bufmgr_gem.c
-@@ -0,0 +1,537 @@
+@@ -0,0 +1,547 @@
+/**************************************************************************
+ *
+ * Copyright © 2007-2008 Red Hat Inc.
@@ -2714,7 +2369,7 @@
+ dri_bufmgr bufmgr;
+ struct radeon_bufmgr radeon_bufmgr;
+ int fd;
-+ uint32_t vram_limit;
++ uint32_t vram_limit, gart_limit;
+ uint32_t vram_write_used, gart_write_used;
+ uint32_t read_used;
+
@@ -3072,9 +2727,16 @@
+
+ if (bufmgr_gem->vram_write_used > bufmgr_gem->vram_limit) {
+ bufmgr_gem->vram_write_used = 0;
++ bufmgr_gem->read_used = 0;
+ return -1;
+ }
+
++ if (bufmgr_gem->read_used > bufmgr_gem->gart_limit) {
++ bufmgr_gem->vram_write_used = 0;
++ bufmgr_gem->read_used = 0;
++ return -1;
++ }
++
+ gem_bo->space_accounted = 1;
+
+ return 0;
@@ -3137,7 +2799,6 @@
+ }
+ }
+
-+// bufmgr_gem->reloc_head = NULL;
+ bufmgr_gem->read_used = 0;
+ bufmgr_gem->vram_write_used = 0;
+
@@ -3161,15 +2822,19 @@
+ return gem_bo->touched;
+}
+
-+void radeon_bufmgr_gem_set_vram_limit(dri_bufmgr *bufmgr, uint32_t vram_limit)
++void radeon_bufmgr_gem_set_limit(dri_bufmgr *bufmgr, uint32_t domain, uint32_t limit)
+{
+ dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bufmgr;
+
-+ bufmgr_gem->vram_limit = vram_limit;
++ if (domain == RADEON_GEM_DOMAIN_VRAM)
++ bufmgr_gem->vram_limit = limit;
++ else
++ bufmgr_gem->gart_limit = limit;
++
+}
diff --git a/src/radeon_bufmgr_gem.h b/src/radeon_bufmgr_gem.h
new file mode 100644
-index 0000000..e4f074c
+index 0000000..c40a24e
--- /dev/null
+++ b/src/radeon_bufmgr_gem.h
@@ -0,0 +1,15 @@
@@ -3186,7 +2851,7 @@
+void radeon_bufmgr_unpin(dri_bo *buf);
+uint32_t radeon_bufmgr_get_handle(dri_bo *buf);
+int radeon_bufmgr_gem_has_references(dri_bo *buf);
-+void radeon_bufmgr_gem_set_vram_limit(dri_bufmgr *bufmgr, uint32_t vram_limit);
++void radeon_bufmgr_gem_set_limit(dri_bufmgr *bufmgr, uint32_t domain, uint32_t limit);
+#endif
diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c
index dba197e..10d146e 100644
@@ -4477,7 +4142,7 @@
+
+#endif
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
-index c759bd6..5ee5d95 100644
+index c759bd6..54cc804 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -224,7 +224,10 @@ radeonShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode,
@@ -5332,7 +4997,7 @@
xf86DrvMsg(scrnIndex, X_ERROR,
"Static buffer allocation failed. Disabling DRI.\n");
xf86DrvMsg(scrnIndex, X_ERROR,
-@@ -3443,15 +3578,39 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+@@ -3443,15 +3578,41 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
}
}
@@ -5352,6 +5017,8 @@
+ info->bufmgr = radeon_bufmgr_gem_init(info->dri->drmFD);
+ drmmode_set_bufmgr(pScrn, &info->drmmode, info->bufmgr);
+ //radeon_bufmgr_gem_enable_reuse(info->bufmgr);
++ radeon_bufmgr_gem_set_limit(info->bufmgr, RADEON_GEM_DOMAIN_GTT, info->mm.gart_size - info->dri->gartTexMapSize);
++
+ radeon_setup_kernel_mem(pScreen);
+ front_ptr = info->mm.front_buffer->map;
+ pScrn->fbOffset = info->mm.front_buffer->offset;
@@ -5375,7 +5042,7 @@
#endif
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing fb layer\n");
-@@ -3475,7 +3634,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+@@ -3475,7 +3636,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
if (info->r600_shadow_fb == FALSE) {
/* Init fb layer */
@@ -5384,7 +5051,7 @@
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
pScrn->bitsPerPixel))
-@@ -3517,8 +3676,10 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+@@ -3517,8 +3678,10 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
/* restore the memory map here otherwise we may get a hang when
* initializing the drm below
*/
@@ -5397,7 +5064,7 @@
/* Backing store setup */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
-@@ -3528,7 +3689,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+@@ -3528,7 +3691,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
/* DRI finalisation */
#ifdef XF86DRI
@@ -5406,7 +5073,7 @@
info->dri->pKernelDRMVersion->version_minor >= 19)
{
if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_PCIGART_LOCATION, info->dri->pciGartOffset) < 0)
-@@ -3547,11 +3708,17 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+@@ -3547,11 +3710,17 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
info->directRenderingEnabled = RADEONDRIFinishScreenInit(pScreen);
}
if (info->directRenderingEnabled) {
@@ -5425,7 +5092,7 @@
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Direct rendering enabled\n");
-@@ -3649,10 +3816,16 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
+@@ -3649,10 +3818,16 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
return FALSE;
}
}
@@ -5443,7 +5110,7 @@
/* Provide SaveScreen & wrap BlockHandler and CloseScreen */
/* Wrap CloseScreen */
-@@ -5133,7 +5306,7 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+@@ -5133,7 +5308,7 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
#ifdef XF86DRI
Bool CPStarted = info->cp->CPStarted;
@@ -5452,7 +5119,7 @@
DRILock(pScrn->pScreen, 0);
RADEONCP_STOP(pScrn, info);
}
-@@ -5156,8 +5329,10 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+@@ -5156,8 +5331,10 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
#endif
}
@@ -5465,7 +5132,7 @@
ret = xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
-@@ -5169,15 +5344,18 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+@@ -5169,15 +5346,18 @@ Bool RADEONSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
/* xf86SetRootClip would do, but can't access that here */
}
@@ -5491,7 +5158,7 @@
}
#endif
-@@ -5375,6 +5553,11 @@ void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
+@@ -5375,6 +5555,11 @@ void RADEONAdjustFrame(int scrnIndex, int x, int y, int flags)
xf86OutputPtr output = config->output[config->compat_output];
xf86CrtcPtr crtc = output->crtc;
@@ -5503,7 +5170,7 @@
#ifdef XF86DRI
if (info->cp->CPStarted && pScrn->pScreen) DRILock(pScrn->pScreen, 0);
#endif
-@@ -5410,67 +5593,84 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
+@@ -5410,67 +5595,84 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONEnterVT\n");
@@ -5634,7 +5301,7 @@
}
#endif
/* this will get XVideo going again, but only if XVideo was initialised
-@@ -5482,7 +5682,7 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
+@@ -5482,7 +5684,7 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
RADEONEngineRestore(pScrn);
#ifdef XF86DRI
@@ -5643,7 +5310,7 @@
RADEONCP_START(pScrn, info);
DRIUnlock(pScrn->pScreen);
}
-@@ -5505,17 +5705,18 @@ void RADEONLeaveVT(int scrnIndex, int flags)
+@@ -5505,17 +5707,18 @@ void RADEONLeaveVT(int scrnIndex, int flags)
"RADEONLeaveVT\n");
#ifdef XF86DRI
if (RADEONPTR(pScrn)->directRenderingInited) {
@@ -5673,7 +5340,7 @@
/* Make sure 3D clients will re-upload textures to video RAM */
if (info->dri->textureSize) {
-@@ -5551,10 +5752,15 @@ void RADEONLeaveVT(int scrnIndex, int flags)
+@@ -5551,10 +5754,15 @@ void RADEONLeaveVT(int scrnIndex, int flags)
xf86_hide_cursors (pScrn);
@@ -5692,7 +5359,7 @@
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Ok, leaving now...\n");
-@@ -5599,7 +5805,8 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
+@@ -5599,7 +5807,8 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
#endif /* USE_XAA */
if (pScrn->vtSema) {
@@ -5702,7 +5369,7 @@
}
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
-@@ -5634,6 +5841,12 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
+@@ -5634,6 +5843,12 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
info->DGAModes = NULL;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Unmapping memory\n");
@@ -6030,7 +5697,7 @@
+
#endif
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
-index 0f86fdd..4736c27 100644
+index 0f86fdd..f0d1f48 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -43,7 +43,11 @@
@@ -6138,7 +5805,7 @@
/* Front buffer is always set with proper swappers */
if (offset == 0)
return;
-@@ -291,14 +341,100 @@ static void RADEONFinishAccess(PixmapPtr pPix, int index)
+@@ -291,14 +341,97 @@ static void RADEONFinishAccess(PixmapPtr pPix, int index)
OUTREG(RADEON_SURFACE0_LOWER_BOUND + soff, 0);
OUTREG(RADEON_SURFACE0_UPPER_BOUND + soff, 0);
swapper_surfaces[index] = 0;
@@ -6208,11 +5875,8 @@
+ if (pPixData == info->mm.front_buffer->map) {
+ driver_priv->flags |= RADEON_PIXMAP_IS_FRONTBUFFER;
+
-+ if (info->new_cs)
-+ driver_priv->bo = radeon_bo_gem_create_from_name(info->bufmgr, "front",
-+ radeon_name_buffer(pScrn, info->mm.front_buffer));
-+ else
-+ driver_priv->bo = radeon_bufmgr_exa_create_bo(info->bufmgr, info->mm.front_buffer);
++ driver_priv->bo = radeon_bo_gem_create_from_name(info->bufmgr, "front",
++ radeon_name_buffer(pScrn, info->mm.front_buffer));
+
+ miModifyPixmapHeader(pPixmap, width, height, depth,
+ bitsPerPixel, devKind, NULL);
@@ -6242,7 +5906,7 @@
switch (info->accel_state->engineMode) { \
case EXA_ENGINEMODE_UNKNOWN: \
wait_until |= RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_2D_IDLECLEAN; \
-@@ -307,15 +443,17 @@ do { \
+@@ -307,15 +440,17 @@ do { \
case EXA_ENGINEMODE_2D: \
break; \
} \
@@ -6264,7 +5928,7 @@
switch (info->accel_state->engineMode) { \
case EXA_ENGINEMODE_UNKNOWN: \
wait_until |= RADEON_WAIT_HOST_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN; \
-@@ -324,8 +462,11 @@ do { \
+@@ -324,8 +459,11 @@ do { \
case EXA_ENGINEMODE_3D: \
break; \
} \
@@ -6278,7 +5942,7 @@
info->accel_state->engineMode = EXA_ENGINEMODE_3D; \
} while (0);
-@@ -338,6 +479,7 @@ do { \
+@@ -338,6 +476,7 @@ do { \
#define BEGIN_ACCEL(n) RADEONWaitForFifo(pScrn, (n))
#define OUT_ACCEL_REG(reg, val) OUTREG(reg, val)
#define OUT_ACCEL_REG_F(reg, val) OUTREG(reg, F_TO_DW(val))
@@ -6286,7 +5950,7 @@
#define FINISH_ACCEL()
#ifdef RENDER
-@@ -351,6 +493,7 @@ do { \
+@@ -351,6 +490,7 @@ do { \
#undef OUT_ACCEL_REG
#undef OUT_ACCEL_REG_F
#undef FINISH_ACCEL
@@ -6294,7 +5958,7 @@
#ifdef XF86DRI
-@@ -361,6 +504,7 @@ do { \
+@@ -361,6 +501,7 @@ do { \
#define BEGIN_ACCEL(n) BEGIN_RING(2*(n))
#define OUT_ACCEL_REG(reg, val) OUT_RING_REG(reg, val)
#define FINISH_ACCEL() ADVANCE_RING()
@@ -6302,7 +5966,7 @@
#define OUT_RING_F(x) OUT_RING(F_TO_DW(x))
-@@ -378,6 +522,8 @@ do { \
+@@ -378,6 +519,8 @@ do { \
#endif /* XF86DRI */
@@ -6311,7 +5975,7 @@
/*
* Once screen->off_screen_base is set, this function
* allocates the remaining memory appropriately
-@@ -399,122 +545,126 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
+@@ -399,122 +542,126 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
if (info->accel_state->exa == NULL)
return FALSE;
@@ -6541,7 +6205,7 @@
return TRUE;
}
-@@ -527,10 +677,21 @@ extern void ExaOffscreenMarkUsed(PixmapPtr);
+@@ -527,10 +674,21 @@ extern void ExaOffscreenMarkUsed(PixmapPtr);
unsigned long long
RADEONTexOffsetStart(PixmapPtr pPix)
{
@@ -7555,10 +7219,10 @@
ExaOffscreenArea *area = mem_struct;
diff --git a/src/radeon_memory.c b/src/radeon_memory.c
new file mode 100644
-index 0000000..244c2de
+index 0000000..273b8f9
--- /dev/null
+++ b/src/radeon_memory.c
-@@ -0,0 +1,412 @@
+@@ -0,0 +1,410 @@
+
+#include <errno.h>
+#include <sys/ioctl.h>
@@ -7891,12 +7555,12 @@
+ else
+ info->dri->textureSize = remain_size_bytes / 2;
+
-+ ErrorF("texture size is %dK, exa is %dK\n", info->dri->textureSize / 1024, (remain_size_bytes - info->dri->textureSize)/1024);
++ remain_size_bytes -= info->dri->textureSize;
+
-+ fb_size_bytes = screen_size + (remain_size_bytes - info->dri->textureSize);
++ ErrorF("texture size is %dK, exa is %dK\n", info->dri->textureSize / 1024, remain_size_bytes/1024);
++
++ fb_size_bytes = screen_size;
+
-+ if (info->new_cs)
-+ fb_size_bytes = screen_size;
+ ErrorF("fb size is %dK %dK\n", fb_size_bytes / 1024, total_size_bytes / 1024);
+
+ info->mm.front_buffer = radeon_allocate_memory(pScrn, RADEON_POOL_VRAM, fb_size_bytes, 0, 1, "Front Buffer + EXA", 1);
@@ -7910,16 +7574,6 @@
+ }
+ info->dri->frontPitch = pScrn->displayWidth;
+
-+ if (!info->new_cs) {
-+ info->accel_state->exa->memoryBase = info->mm.front_buffer->map;
-+ info->accel_state->exa->offScreenBase = screen_size;
-+ info->accel_state->exa->memorySize = fb_size_bytes;
-+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-+ "Will use %ld kb for X Server offscreen at offset 0x%08lx\n",
-+ (info->accel_state->exa->memorySize - info->accel_state->exa->offScreenBase) /
-+ 1024, info->accel_state->exa->offScreenBase);
-+ }
-+
+ if (info->directRenderingEnabled) {
+ info->mm.texture_buffer = radeon_allocate_memory(pScrn, RADEON_POOL_VRAM, info->dri->textureSize, 0, 1, "Texture Buffer", 1);
+ if (!info->mm.texture_buffer) {
@@ -7931,7 +7585,14 @@
+ if (info->drm_mode_setting) {
+ drmmode_set_fb(pScrn, &info->drmmode, pScrn->virtualX, RADEON_ALIGN(pScrn->virtualY, 16), stride, info->mm.front_buffer->kernel_bo_handle);
+ }
-+ radeon_bufmgr_gem_set_vram_limit(info->bufmgr, remain_size_bytes / 2);
++
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Front buffer size: %dK at 0x%08x\n", info->mm.front_buffer->size/1024, info->mm.front_buffer->offset);
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Back buffer size: %dK at 0x%08x\n", info->mm.back_buffer->size/1024, info->mm.back_buffer->offset);
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Depth buffer size: %dK at 0x%08x\n", info->mm.depth_buffer->size/1024, info->mm.depth_buffer->offset);
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Texture size: %dK at 0x%08x\n", info->mm.texture_buffer->size/1024, info->mm.texture_buffer->offset);
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Remaining VRAM size (used for pixmaps): %dK\n", remain_size_bytes/1024);
++
++ radeon_bufmgr_gem_set_limit(info->bufmgr, RADEON_GEM_DOMAIN_VRAM, remain_size_bytes);
+ return TRUE;
+}
+
@@ -7951,6 +7612,7 @@
+ }
+
+ radeon_bind_memory(pScrn, info->mm.gart_texture_buffer);
++
+ return TRUE;
+}
+
Index: xorg-x11-drv-ati.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-ati/F-10/xorg-x11-drv-ati.spec,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -r1.143 -r1.144
--- xorg-x11-drv-ati.spec 10 Nov 2008 01:28:34 -0000 1.143
+++ xorg-x11-drv-ati.spec 10 Nov 2008 05:06:38 -0000 1.144
@@ -5,7 +5,7 @@
Summary: Xorg X11 ati video driver
Name: xorg-x11-drv-ati
Version: 6.9.0
-Release: 43%{?dist}
+Release: 44%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -82,6 +82,9 @@
%{_mandir}/man4/radeon.4*
%changelog
+* Mon Nov 10 2008 Dave Airlie <airlied at redhat.com> 6.9.0-44
+- fix rendering from very large pixmaps (#468571)
+
* Mon Nov 10 2008 Dave Airlie <airlied at redhat.com> 6.9.0-43
- radeon-modeset.patch: fix dpms + xv (#470050)
More information about the fedora-extras-commits
mailing list