summaryrefslogtreecommitdiff
path: root/src/uxa/intel_dri.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-11-05 11:56:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-11-06 16:55:46 +0000
commit0aa2edbd29c8dd26a5f3748e3875c445ea358a6d (patch)
treea9702e0e957ee6c1826807c12af640184580c9c5 /src/uxa/intel_dri.c
parent4281bbdd5be1f846c217cdf6d09536779cd324ce (diff)
Remove defunct glamor support
It never was a stable or complete replacement, and now it is incorporated in Xorg itself! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/uxa/intel_dri.c')
-rw-r--r--src/uxa/intel_dri.c131
1 files changed, 4 insertions, 127 deletions
diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c
index dfe7a458..5b5e3fc4 100644
--- a/src/uxa/intel_dri.c
+++ b/src/uxa/intel_dri.c
@@ -69,7 +69,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#if USE_UXA
#include "intel_uxa.h"
#endif
-#include "intel_glamor.h"
typedef struct {
int refcnt;
@@ -109,58 +108,6 @@ static PixmapPtr get_front_buffer(DrawablePtr drawable)
return pixmap;
}
-static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
-{
- ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
- intel_screen_private *intel = intel_get_screen_private(scrn);
- PixmapPtr old = get_drawable_pixmap(drawable);
- struct intel_uxa_pixmap *priv = intel_uxa_get_pixmap_private(pixmap);
- GCPtr gc;
-
- /* With a glamor pixmap, 2D pixmaps are created in texture
- * and without a static BO attached to it. To support DRI,
- * we need to create a new textured-drm pixmap and
- * need to copy the original content to this new textured-drm
- * pixmap, and then convert the old pixmap to a coherent
- * textured-drm pixmap which has a valid BO attached to it
- * and also has a valid texture, thus both glamor and DRI2
- * can access it.
- *
- */
-
- /* Copy the current contents of the pixmap to the bo. */
- gc = GetScratchGC(drawable->depth, screen);
- if (gc) {
- ValidateGC(&pixmap->drawable, gc);
- gc->ops->CopyArea(drawable, &pixmap->drawable,
- gc,
- 0, 0,
- drawable->width,
- drawable->height,
- 0, 0);
- FreeScratchGC(gc);
- }
-
- intel_uxa_set_pixmap_private(pixmap, NULL);
-
- /* Exchange the underlying texture/image. */
- intel_glamor_exchange_buffers(intel, old, pixmap);
- /* And redirect the pixmap to the new bo (for 3D). */
- intel_uxa_set_pixmap_private(old, priv);
- old->refcnt++;
-
- screen->ModifyPixmapHeader(old,
- drawable->width,
- drawable->height,
- 0, 0,
- intel_pixmap_pitch(pixmap),
- NULL);
- screen->DestroyPixmap(pixmap);
- intel_get_screen_private(xf86ScreenToScrn(screen))->needs_flush = TRUE;
- return old;
-}
-
#if DRI2INFOREC_VERSION < 2
static DRI2BufferPtr
I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
@@ -172,7 +119,6 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
DRI2BufferPtr buffers;
I830DRI2BufferPrivatePtr privates;
PixmapPtr pixmap, pDepthPixmap;
- Bool is_glamor_pixmap = FALSE;
int i;
buffers = calloc(count, sizeof *buffers);
@@ -190,10 +136,8 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
if (attachments[i] == DRI2BufferFrontLeft) {
pixmap = get_front_buffer(drawable);
- if (pixmap == NULL) {
+ if (pixmap == NULL)
drawable = &(get_drawable_pixmap(drawable)->drawable);
- is_glamor_pixmap = TRUE;
- }
} else if (attachments[i] == DRI2BufferStencil && pDepthPixmap) {
pixmap = pDepthPixmap;
pixmap->refcnt++;
@@ -231,9 +175,6 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
screen->DestroyPixmap(pixmap);
goto unwind;
}
-
- if (is_glamor_pixmap)
- pixmap = fixup_glamor(drawable, pixmap);
}
if (attachments[i] == DRI2BufferDepth)
@@ -294,7 +235,6 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
DRI2Buffer2Ptr buffer;
I830DRI2BufferPrivatePtr privates;
PixmapPtr pixmap;
- Bool is_glamor_pixmap = FALSE;
buffer = calloc(1, sizeof *buffer);
if (buffer == NULL)
@@ -308,11 +248,8 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
pixmap = NULL;
if (attachment == DRI2BufferFrontLeft) {
pixmap = get_front_buffer(drawable);
-
- if (pixmap == NULL) {
+ if (pixmap == NULL)
drawable = &(get_drawable_pixmap(drawable)->drawable);
- is_glamor_pixmap = TRUE;
- }
}
if (pixmap == NULL) {
@@ -385,8 +322,6 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
free(buffer);
return NULL;
}
- if (is_glamor_pixmap)
- pixmap = fixup_glamor(drawable, pixmap);
}
buffer->attachment = attachment;
@@ -764,8 +699,6 @@ intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr fron
new_front->busy = 1;
new_back->busy = -1;
- intel_glamor_exchange_buffers(intel, front, back);
-
DamageRegionProcessPending(&front->drawable);
return new_front;
@@ -795,38 +728,6 @@ I830DRI2ExchangeBuffers(struct intel_screen_private *intel, DRI2BufferPtr front,
dri_bo_reference (intel->front_buffer);
}
-static PixmapPtr
-intel_glamor_create_back_pixmap(ScreenPtr screen,
- PixmapPtr front_pixmap,
- drm_intel_bo *back_bo)
-{
- PixmapPtr back_pixmap;
-
- back_pixmap = screen->CreatePixmap(screen,
- 0,
- 0,
- front_pixmap->drawable.depth,
- 0);
- if (back_pixmap == NULL)
- return NULL;
-
- screen->ModifyPixmapHeader(back_pixmap,
- front_pixmap->drawable.width,
- front_pixmap->drawable.height,
- 0, 0,
- front_pixmap->devKind,
- 0);
- intel_set_pixmap_bo(back_pixmap, back_bo);
- if (!intel_glamor_create_textured_pixmap(back_pixmap)) {
- ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "Failed to create textured back pixmap.\n");
- screen->DestroyPixmap(back_pixmap);
- return NULL;
- }
- return back_pixmap;
-}
-
static drm_intel_bo *get_pixmap_bo(I830DRI2BufferPrivatePtr priv)
{
drm_intel_bo *bo = intel_get_pixmap_bo(priv->pixmap);
@@ -885,10 +786,6 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
}
if (intel->back_buffer == NULL) {
- I830DRI2BufferPrivatePtr drvpriv;
- PixmapPtr front_pixmap, back_pixmap;
- ScreenPtr screen;
-
new_back = drm_intel_bo_alloc(intel->bufmgr, "front buffer",
intel->front_buffer->size, 0);
if (new_back == NULL)
@@ -905,21 +802,6 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
drm_intel_bo_disable_reuse(new_back);
dri_bo_flink(new_back, &intel->back_name);
-
- if ((intel->uxa_flags & UXA_USE_GLAMOR)) {
- screen = draw->pScreen;
- drvpriv = info->front->driverPrivate;
- front_pixmap = drvpriv->pixmap;
-
- back_pixmap = intel_glamor_create_back_pixmap(screen,
- front_pixmap,
- new_back);
- if (back_pixmap == NULL) {
- drm_intel_bo_unreference(new_back);
- return FALSE;
- }
- intel->back_pixmap = back_pixmap;
- }
} else {
new_back = intel->back_buffer;
intel->back_buffer = NULL;
@@ -939,13 +821,8 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
intel->back_buffer = intel->front_buffer;
drm_intel_bo_reference(intel->back_buffer);
- if (!(intel->uxa_flags & UXA_USE_GLAMOR)) {
- intel_set_pixmap_bo(priv->pixmap, new_back);
- drm_intel_bo_unreference(new_back);
- }
- else
- intel_exchange_pixmap_buffers(intel, priv->pixmap,
- intel->back_pixmap);
+ intel_exchange_pixmap_buffers(intel, priv->pixmap,
+ intel->back_pixmap);
tmp_name = info->front->name;
info->front->name = intel->back_name;