intel_sprite_on: plane needs 16.16 width and height
authorBen Widawsky <ben@bwidawsk.net>
Thu, 13 Sep 2012 00:48:21 +0000 (17:48 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Thu, 13 Sep 2012 00:49:45 +0000 (17:49 -0700)
This only ever worked because we used to have a bug in our driver which
was fixed months ago by:

commit b4db1e35ac59c144965f517bc575a0d75b60b03f
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Tue Mar 20 10:59:09 2012 -0700

    drm/i915: treat src w & h as fixed point in sprite handling code

Reported-by: Armin Reese <armin.c.reese@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
demos/intel_sprite_on.c

index b338fb7..62bd98e 100644 (file)
@@ -819,11 +819,13 @@ static void ricochet(int tiled, int sprite_w, int sprite_h,
 
                        // Move the sprite on the screen and flip
                        // the surface if the index has changed
+                       // NB: sprite_w and sprite_h must be 16.16 fixed point, herego << 16
                        if (drmModeSetPlane(gfx_fd, sprite_plane_id, curr_connector.crtc,
                                            sprite_fb_id[sprite_index], plane_flags,
                                            sprite_x, sprite_y,
                                            out_w, out_h,
-                                           0, 0, sprite_w, sprite_h))
+                                           0, 0,
+                                           sprite_w << 16, sprite_h << 16))
                                printf("Failed to enable sprite plane: %s\n", strerror(errno));
 
                        // Check if it's time to move the sprite surface