Lines Matching refs:pixmap

184 radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_buffer *bo)
186 ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
193 return glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap,
200 return glamor_egl_create_textured_pixmap(pixmap,
202 pixmap->devKind);
206 static Bool radeon_glamor_destroy_pixmap(PixmapPtr pixmap)
209 ScreenPtr screen = pixmap->drawable.pScreen;
214 if (pixmap->refcnt == 1) {
216 glamor_egl_destroy_textured_pixmap(pixmap);
218 radeon_set_pixmap_bo(pixmap, NULL);
222 fbDestroyPixmap(pixmap);
226 ret = screen->DestroyPixmap(pixmap);
241 PixmapPtr pixmap, new_pixmap = NULL;
251 pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
252 if (pixmap)
253 return pixmap;
266 pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
267 if (pixmap == NullPixmap)
268 return pixmap;
278 pixmap->drawable.bitsPerPixel,
284 radeon_set_pixmap_private(pixmap, priv);
286 screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, stride, NULL);
288 if (!radeon_glamor_create_textured_pixmap(pixmap, priv->bo))
291 pixmap->devPrivate.ptr = NULL;
294 return pixmap;
299 * Glamor don't know how to handle a BO only pixmap. Put
303 "Failed to create textured DRI2/PRIME pixmap.");
305 radeon_glamor_destroy_pixmap(pixmap);
308 /* Create textured pixmap failed means glamor failed to
310 * to create a new glamor pixmap and clean up current one.
311 * One thing need to be noted, this new pixmap doesn't
313 * to take care of it. Glamor will mark this new pixmap as a
314 * texture only pixmap and will never fallback to DDX layer
322 fbDestroyPixmap(pixmap);
330 radeon_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap)
334 struct radeon_pixmap *priv = radeon_get_pixmap_private(pixmap);
337 /* With a glamor pixmap, 2D pixmaps are created in texture
339 * we need to create a new textured-drm pixmap and
341 * pixmap, and then convert the old pixmap to a coherent
342 * textured-drm pixmap which has a valid BO attached to it
348 /* Copy the current contents of the pixmap to the bo. */
351 ValidateGC(&pixmap->drawable, gc);
352 gc->ops->CopyArea(&old->drawable, &pixmap->drawable,
360 /* And redirect the pixmap to the new bo (for 3D). */
361 glamor_egl_exchange_buffers(old, pixmap);
362 radeon_set_pixmap_private(pixmap, radeon_get_pixmap_private(old));
368 0, 0, pixmap->devKind, NULL);
371 screen->DestroyPixmap(pixmap);
378 radeon_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr secondary,
381 ScreenPtr screen = pixmap->drawable.pScreen;
386 if ((radeon_get_pixmap_tiling_flags(pixmap) &
390 /* We don't want to re-allocate the screen pixmap as
393 if (screen->GetScreenPixmap(screen) == pixmap)
396 linear = screen->CreatePixmap(screen, pixmap->drawable.width,
397 pixmap->drawable.height,
398 pixmap->drawable.depth,
403 radeon_glamor_set_pixmap_bo(&pixmap->drawable, linear);
406 fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size);
415 radeon_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
417 ScreenPtr screen = pixmap->drawable.pScreen;
421 if (!radeon_set_shared_pixmap_backing(pixmap, handle, NULL))
425 !radeon_glamor_create_textured_pixmap(pixmap,
426 radeon_get_pixmap_bo(pixmap))) {
428 "Failed to get PRIME drawable for glamor pixmap.\n");
432 screen->ModifyPixmapHeader(pixmap,
433 pixmap->drawable.width,
434 pixmap->drawable.height,
476 "Failed to initialize textured pixmap of screen for glamor.\n");