xf86-video-intel: 2 commits - src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 5 02:14:21 PDT 2013


 src/sna/sna_display.c |   38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

New commits:
commit f5529ea61b5e12e0c2d9fda817948ca0a4cab212
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 4 21:39:33 2013 +0100

    sna: Use a stack allocated PixmapRec for the fbcon copy
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 33cbac7..e1fc6fc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -987,7 +987,7 @@ void sna_copy_fbcon(struct sna *sna)
 {
 	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn);
 	struct drm_mode_fb_cmd fbcon;
-	PixmapPtr scratch;
+	PixmapRec scratch;
 	struct sna_pixmap *priv;
 	struct kgem_bo *bo;
 	BoxRec box;
@@ -1041,27 +1041,22 @@ void sna_copy_fbcon(struct sna *sna)
 	DBG(("%s: found fbcon, size=%dx%d, depth=%d, bpp=%d\n",
 	     __FUNCTION__, fbcon.width, fbcon.height, fbcon.depth, fbcon.bpp));
 
-	/* Wrap the fbcon in a pixmap so that we select the right formats
-	 * in the render copy in case we need to preserve the fbcon
-	 * across a depth change upon starting X.
-	 */
-	scratch = GetScratchPixmapHeader(sna->scrn->pScreen,
-					fbcon.width, fbcon.height,
-					fbcon.depth, fbcon.bpp,
-					0, NULL);
-	if (scratch == NullPixmap)
+	bo = sna_create_bo_for_fbcon(sna, &fbcon);
+	if (bo == NULL)
 		return;
 
+	DBG(("%s: fbcon handle=%d\n", __FUNCTION__, bo->handle));
+
+	scratch.drawable.width = fbcon.width;
+	scratch.drawable.height = fbcon.height;
+	scratch.drawable.depth = fbcon.depth;
+	scratch.drawable.bitsPerPixel = fbcon.bpp;
+	scratch.devPrivate.ptr = NULL;
+
 	box.x1 = box.y1 = 0;
 	box.x2 = min(fbcon.width, sna->front->drawable.width);
 	box.y2 = min(fbcon.height, sna->front->drawable.height);
 
-	bo = sna_create_bo_for_fbcon(sna, &fbcon);
-	if (bo == NULL)
-		goto cleanup_scratch;
-
-	DBG(("%s: fbcon handle=%d\n", __FUNCTION__, bo->handle));
-
 	sx = dx = 0;
 	if (box.x2 < (uint16_t)fbcon.width)
 		sx = (fbcon.width - box.x2) / 2;
@@ -1075,7 +1070,7 @@ void sna_copy_fbcon(struct sna *sna)
 		dy = (sna->front->drawable.height - box.y2) / 2;
 
 	ok = sna->render.copy_boxes(sna, GXcopy,
-				    scratch, bo, sx, sy,
+				    &scratch, bo, sx, sy,
 				    sna->front, priv->gpu_bo, dx, dy,
 				    &box, 1, 0);
 	if (!DAMAGE_IS_ALL(priv->gpu_damage))
@@ -1086,9 +1081,6 @@ void sna_copy_fbcon(struct sna *sna)
 #if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(10, 0)
 	sna->scrn->pScreen->canDoBGNoneRoot = ok;
 #endif
-
-cleanup_scratch:
-	FreeScratchPixmapHeader(scratch);
 }
 
 static bool use_shadow(struct sna *sna, xf86CrtcPtr crtc)
commit ea508c177c961ba2f00129476a22a32ff3ea6f1b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 4 20:19:20 2013 +0100

    sna: Set 1024x768 fb in absence of any connected devices
    
    No actual initial configration magic is required, all we need to do is
    set the initial framebuffer size with no connected outputs and leave it
    to the core to select CompatOutput() the like.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 0a97fec..33cbac7 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3171,8 +3171,10 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 			height = h;
 	}
 
-	if (!width || !height)
-		return false;
+	if (!width || !height) {
+		width = 1024;
+		height = 768;
+	}
 
 	scrn->display->frameX0 = 0;
 	scrn->display->frameY0 = 0;


More information about the xorg-commit mailing list