Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Reese, Armin C" <armin.c.reese@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: SNB/IVB sprite demo
Date: Fri, 17 Feb 2012 19:22:19 +0000	[thread overview]
Message-ID: <07EEC142D30DAC40BA4DD9C0F9EE51090BC90C@FMSMSX102.amr.corp.intel.com> (raw)
In-Reply-To: <20120211105326.GC4531@phenom.ffwll.local>

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

Yeah, I got lazy and just did a diff.  Sorry about that ...

Here is a real git patch made by "git diff sprite_on.c"

Thanks & have a good weekend,
Armin

-----Original Message-----
From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel Vetter
Sent: Saturday, February 11, 2012 2:53 AM
To: Reese, Armin C
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] SNB/IVB sprite demo

Hi Armin,

On Sat, Feb 11, 2012 at 01:11:16AM +0000, Reese, Armin C wrote:
> Thanks for letting me know about the GCC warning messages.  I did my 
> final tweeks on the program in Android and compiled in that environment.
> The compiler there is a bit blind and the build jobs generate so much 
> output, it's easy to ignore warnings.

Np. Btw I've just merged the Android build patches for i-g-t in case that's useful for you.

> Anyway, I'll be more careful next time.  The GCC compiler on my Ubuntu
> 11.04 system is version 4.5.2.  I haven't installed 4.6.2 yet.  GCC 
> produced no warnings after the patch was applied.  I attached both the 
> patch and the new source code for sprite_on.c.

Thanks, patch looks nice. Can I have it as a git patch? That's much esier to handle than your patch which contains funny paths into your own home directory ;-)

/me is a lazy bastard

> Thanks for taking time for this.  I intend on adding color key support 
> into sprite_on.c to validate operation of that feature, so there will 
> be more patches coming.

Awesome, but I that case if more stuff is to show up, I _really_ prefer git patches.

Cheers, Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

[-- Attachment #2: sprite_on_patch --]
[-- Type: application/octet-stream, Size: 3927 bytes --]

diff --git a/tests/sprite_on.c b/tests/sprite_on.c
index 49ccff2..585189d 100644
--- a/tests/sprite_on.c
+++ b/tests/sprite_on.c
@@ -52,12 +52,12 @@
 
 struct type_name
 {
-	int type;
-	char *name;
+	int                 type;
+	const char          *name;
 };
 
 #define type_name_fn(res) \
-static char * res##_str(int type) {			\
+static const char * res##_str(int type) {			\
 	unsigned int i;					\
 	for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
 		if (res##_names[i].type == type)	\
@@ -459,50 +459,6 @@ static int connector_find_plane(int gfx_fd, struct connector *c)
 
 //*****************************************************************************
 //
-// disable_planes
-//
-//*****************************************************************************
-static void disable_planes(
-        int                     gfx_fd)
-{
-	struct                  connector *connectors;
-    drmModeRes              *resources;
-	int                     c;
-
-	resources = drmModeGetResources(gfx_fd);
-	if (!resources) {
-		printf("drmModeGetResources failed: %s\n",
-			   strerror(errno));
-		return;
-	}
-
-	connectors = calloc(resources->count_connectors,
-			    sizeof(struct connector));
-	if (!connectors)
-		return;
-
-	/* Find any connected displays */
-	for (c = 0; c < resources->count_connectors; c++) {
-		uint32_t sprite_plane_id;
-
-		sprite_plane_id = connector_find_plane(gfx_fd, &connectors[c]);
-		if (!sprite_plane_id) {
-			printf("failed to find plane for crtc\n");
-			return;
-		}
-		if (drmModeSetPlane(gfx_fd, sprite_plane_id, connectors[c].crtc, 0, 0, 0,
-				    0, 0, 0, 0, 0, 0, 0)) {
-			printf("failed to disable plane: %s\n",
-				strerror(errno));
-			return;
-		}
-	}
-	drmModeFreeResources(resources);
-	return;
-}
-
-//*****************************************************************************
-//
 // prepare_primary_surface
 //
 //*****************************************************************************
@@ -919,14 +875,14 @@ static void ricochet(
                    "        .flags = %08x\n"
                    "    drmModeEncoder ...\n"
                    "        .encoder_id = %d\n"
-                   "        .encoder_type = %d\n"
+                   "        .encoder_type = %d (%s)\n"
                    "        .crtc_id = %d\n"
                    "        .possible_crtcs = %d\n"
                    "        .possible_clones = %d\n"
                    "    drmModeConnector ...\n"
                    "        .connector_id = %d\n"
                    "        .encoder_id = %d\n"
-                   "        .connector_type = %d\n"
+                   "        .connector_type = %d (%s)\n"
                    "        .connector_type_id = %d\n\n",
                    curr_connector.id,
                    curr_connector.mode_valid,
@@ -937,12 +893,14 @@ static void ricochet(
                    curr_connector.mode.flags,
                    curr_connector.encoder->encoder_id,
                    curr_connector.encoder->encoder_type,
+                   encoder_type_str(curr_connector.encoder->encoder_type),
                    curr_connector.encoder->crtc_id,
                    curr_connector.encoder->possible_crtcs,
                    curr_connector.encoder->possible_clones,
                    curr_connector.connector->connector_id,
                    curr_connector.connector->encoder_id,
                    curr_connector.connector->connector_type,
+                   connector_type_str(curr_connector.connector->connector_type),
                    curr_connector.connector->connector_type_id);
 
             printf("Sprite surface dimensions = %dx%d\n"
@@ -988,7 +946,7 @@ static void ricochet(
         if (out_w > prim_width / 2)
             out_w = prim_width / 2;
         if (out_h > prim_height / 2)
-            out_h - prim_height / 2;
+            out_h = prim_height / 2;
 
         delta_x = 3;
         delta_y = 4;

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2012-02-17 19:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-11  1:11 SNB/IVB sprite demo Reese, Armin C
2012-02-11 10:53 ` Daniel Vetter
2012-02-17 19:22   ` Reese, Armin C [this message]
2012-02-18 16:59     ` Paul Menzel
2012-02-22 10:00     ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2012-02-08  2:16 Reese, Armin C
2012-02-08 15:50 ` Daniel Vetter
2012-02-08 18:14   ` Jesse Barnes
2012-02-10 17:48 ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07EEC142D30DAC40BA4DD9C0F9EE51090BC90C@FMSMSX102.amr.corp.intel.com \
    --to=armin.c.reese@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox