[Intel-gfx] [PATCH 00/13] rip out i830_memory, part 1: everything but xvmc

Carl Worth cworth at cworth.org
Tue Mar 2 20:56:14 CET 2010


On Tue, 02 Mar 2010 09:58:37 -0800, Eric Anholt <eric at anholt.net> wrote:
> > Patch 2 is something I've stumbled upon while doing this cleanup. Totally
> > untested because I don't have i965 class hw, but it makes much more sense this
> > way. Please review carefully.

I didn't test this directly, but I agree that the code being changed
looks entirely insane before the change, (one of those, "How could this
even work?!" cases).

Still, it's quite separable from the series, and could use some testing
(or at least some additional commit-message explanation), so I think
I'll wait on it.

> > Carl, can you please either NAK this as too much, too late for 2.11 or
> > review and merge? If no one NAKs it, I'll send out the xvmc part in a few
> > days. It's ready and tested like this one, but I don't want to unnecessarily
> > patch-bomb everyone.
> 
> Reviewed-by: Eric Anholt <eric at anholt.net>

Thanks, Eric.

I've got the whole series ready to push. I did notice the following
warning though:

i830_memory.c:234: warning: ‘i830_allocate_memory’ defined but not used

for which I've written the patch below. With an ACK on that, I'll push
out the whole series.

-Carl

--->8---

From 1a73e0ac40d69bb90100cee139f3ee1a79c2bf3a Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth at cworth.org>
Date: Tue, 2 Mar 2010 11:49:18 -0800
Subject: [PATCH] i830_memory: Restrict i830_allocate_memory and i830_free_memory to INTEL_XVMC

These functions aren't used when INTEL_XVMC is not defined, so we might
as well not even compile them in that case.
---
 src/i830_memory.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/i830_memory.c b/src/i830_memory.c
index c6003a5..1924746 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -163,6 +163,7 @@ i830_check_display_stride(ScrnInfoPtr scrn, int stride, Bool tiling)
 		return FALSE;
 }
 
+#ifdef INTEL_XVMC
 static void i830_free_memory(ScrnInfoPtr scrn, i830_memory * mem)
 {
 	intel_screen_private *intel = intel_get_screen_private(scrn);
@@ -187,6 +188,7 @@ static void i830_free_memory(ScrnInfoPtr scrn, i830_memory * mem)
 	xfree(mem);
 	return;
 }
+#endif
 
 /* Resets the state of the aperture allocator, freeing all memory that had
  * been allocated.
@@ -196,9 +198,11 @@ void i830_reset_allocations(ScrnInfoPtr scrn)
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	int p;
 
+#ifdef INTEL_XVMC
 	/* Free any allocations in buffer objects */
 	while (intel->bo_list != NULL)
 		i830_free_memory(scrn, intel->bo_list);
+#endif
 
 	/* Null out the pointers for all the allocations we just freed.  This is
 	 * kind of gross, but at least it's just one place now.
@@ -212,6 +216,7 @@ void i830_reset_allocations(ScrnInfoPtr scrn)
 	intel->front_buffer = NULL;
 }
 
+#ifdef INTEL_XVMC
 /* Allocates video memory at the given size, pitch, alignment and tile format.
  *
  * The memory will be bound automatically when the driver is in control of the
@@ -297,6 +302,7 @@ static i830_memory *i830_allocate_memory(ScrnInfoPtr scrn, const char *name,
 
 	return mem;
 }
+#endif
 
 static Bool IsTileable(ScrnInfoPtr scrn, int pitch)
 {
-- 
1.6.5.7

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20100302/be775d92/attachment.sig>


More information about the Intel-gfx mailing list