summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_crtc.c15
-rw-r--r--src/gallium/state_trackers/xorg/xorg_dri2.c4
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c86
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa.c38
-rw-r--r--src/gallium/state_trackers/xorg/xorg_renderer.c2
-rw-r--r--src/gallium/state_trackers/xorg/xorg_tracker.h7
-rw-r--r--src/gallium/state_trackers/xorg/xorg_xv.c130
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/surface.c11
8 files changed, 180 insertions, 113 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
index 9e8c14d741..c776faa53f 100644
--- a/src/gallium/state_trackers/xorg/xorg_crtc.c
+++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
@@ -50,6 +50,7 @@
#endif
#include "pipe/p_inlines.h"
+#include "util/u_format.h"
#include "util/u_rect.h"
#ifdef HAVE_LIBKMS
@@ -200,7 +201,6 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
templat.format = PIPE_FORMAT_A8R8G8B8_UNORM;
templat.width0 = 64;
templat.height0 = 64;
- pf_get_block(templat.format, &templat.block);
crtcp->cursor_tex = ms->screen->texture_create(ms->screen,
&templat);
@@ -216,7 +216,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
PIPE_TRANSFER_WRITE,
0, 0, 64, 64);
ptr = ms->screen->transfer_map(ms->screen, transfer);
- util_copy_rect(ptr, &crtcp->cursor_tex->block,
+ util_copy_rect(ptr, crtcp->cursor_tex->format,
transfer->stride, 0, 0,
64, 64, (void*)image, 64 * 4, 0, 0);
ms->screen->transfer_unmap(ms->screen, transfer);
@@ -257,7 +257,7 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
return;
err_bo_destroy:
- kms_bo_destroy(crtcp->cursor_bo);
+ kms_bo_destroy(&crtcp->cursor_bo);
}
#endif
@@ -305,10 +305,8 @@ xorg_crtc_cursor_destroy(xf86CrtcPtr crtc)
pipe_texture_reference(&crtcp->cursor_tex, NULL);
#ifdef HAVE_LIBKMS
if (crtcp->cursor_bo)
- kms_bo_destroy(crtcp->cursor_bo);
+ kms_bo_destroy(&crtcp->cursor_bo);
#endif
-
- xfree(crtcp);
}
/*
@@ -320,11 +318,12 @@ crtc_destroy(xf86CrtcPtr crtc)
{
struct crtc_private *crtcp = crtc->driver_private;
- if (crtcp->cursor_tex)
- pipe_texture_reference(&crtcp->cursor_tex, NULL);
+ xorg_crtc_cursor_destroy(crtc);
drmModeFreeCrtc(crtcp->drm_crtc);
+
xfree(crtcp);
+ crtc->driver_private = NULL;
}
static const xf86CrtcFuncsRec crtc_funcs = {
diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c
index 2394f004d2..fd82f4fa1d 100644
--- a/src/gallium/state_trackers/xorg/xorg_dri2.c
+++ b/src/gallium/state_trackers/xorg/xorg_dri2.c
@@ -40,6 +40,7 @@
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
+#include "util/u_format.h"
#include "util/u_rect.h"
/* Make all the #if cases in the code esier to read */
@@ -92,7 +93,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
case 9:
#endif
if (exa_priv->depth_stencil_tex &&
- !pf_is_depth_stencil(exa_priv->depth_stencil_tex->format))
+ !util_format_is_depth_or_stencil(exa_priv->depth_stencil_tex->format))
exa_priv->depth_stencil_tex = NULL;
/* Fall through */
case DRI2BufferDepth:
@@ -108,7 +109,6 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
else
template.format = ms->ds_depth_bits_last ?
PIPE_FORMAT_S8Z24_UNORM : PIPE_FORMAT_Z24S8_UNORM;
- pf_get_block(template.format, &template.block);
template.width0 = pDraw->width;
template.height0 = pDraw->height;
template.depth0 = 1;
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index 1291591298..8a24aa10a3 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -260,8 +260,7 @@ drv_close_resource_management(ScrnInfoPtr pScrn)
#ifdef HAVE_LIBKMS
if (ms->kms)
- kms_destroy(ms->kms);
- ms->kms = NULL;
+ kms_destroy(&ms->kms);
#endif
return TRUE;
@@ -481,7 +480,7 @@ static void drv_block_handler(int i, pointer blockData, pointer pTimeout,
if (num_cliprects) {
drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip));
BoxPtr rect = REGION_RECTS(dirty);
- int i;
+ int i, ret;
/* XXX no need for copy? */
for (i = 0; i < num_cliprects; i++, rect++) {
@@ -492,7 +491,11 @@ static void drv_block_handler(int i, pointer blockData, pointer pTimeout,
}
/* TODO query connector property to see if this is needed */
- drmModeDirtyFB(ms->fd, ms->fb_id, clip, num_cliprects);
+ ret = drmModeDirtyFB(ms->fd, ms->fb_id, clip, num_cliprects);
+ if (ret) {
+ debug_printf("%s: failed to send dirty (%i, %s)\n",
+ __func__, ret, strerror(-ret));
+ }
DamageEmpty(ms->damage);
}
@@ -652,6 +655,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
+ if (ms->winsys_screen_init)
+ ms->winsys_screen_init(pScrn);
+
return drv_enter_vt(scrnIndex, 1);
}
@@ -685,6 +691,9 @@ drv_leave_vt(int scrnIndex, int flags)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int o;
+ if (ms->winsys_leave_vt)
+ ms->winsys_leave_vt(pScrn);
+
for (o = 0; o < config->num_crtc; o++) {
xf86CrtcPtr crtc = config->crtc[o];
@@ -747,6 +756,9 @@ drv_enter_vt(int scrnIndex, int flags)
if (!xf86SetDesiredModes(pScrn))
return FALSE;
+ if (ms->winsys_enter_vt)
+ ms->winsys_enter_vt(pScrn);
+
return TRUE;
}
@@ -768,6 +780,9 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
drv_leave_vt(scrnIndex, 0);
}
+ if (ms->winsys_screen_close)
+ ms->winsys_screen_close(pScrn);
+
#ifdef DRI2
if (ms->screen)
xorg_dri2_close(pScreen);
@@ -826,6 +841,7 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn)
modesettingPtr ms = modesettingPTR(pScrn);
unsigned handle, stride;
struct pipe_texture *tex;
+ int ret;
ms->noEvict = TRUE;
@@ -839,16 +855,21 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn)
tex,
&stride,
&handle))
- return FALSE;
+ goto err_destroy;
- drmModeAddFB(ms->fd,
- pScrn->virtualX,
- pScrn->virtualY,
- pScrn->depth,
- pScrn->bitsPerPixel,
- stride,
- handle,
- &ms->fb_id);
+ ret = drmModeAddFB(ms->fd,
+ pScrn->virtualX,
+ pScrn->virtualY,
+ pScrn->depth,
+ pScrn->bitsPerPixel,
+ stride,
+ handle,
+ &ms->fb_id);
+ if (ret) {
+ debug_printf("%s: failed to create framebuffer (%i, %s)",
+ __func__, ret, strerror(-ret));
+ goto err_destroy;
+ }
pScrn->frameX0 = 0;
pScrn->frameY0 = 0;
@@ -858,6 +879,10 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn)
pipe_texture_reference(&tex, NULL);
return TRUE;
+
+err_destroy:
+ pipe_texture_reference(&tex, NULL);
+ return FALSE;
}
static Bool
@@ -887,13 +912,14 @@ static Bool
drv_destroy_front_buffer_kms(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
+ ScreenPtr pScreen = pScrn->pScreen;
+ PixmapPtr rootPixmap = pScreen->GetScreenPixmap(pScreen);
if (!ms->root_bo)
return TRUE;
kms_bo_unmap(ms->root_bo);
- kms_bo_destroy(ms->root_bo);
- ms->root_bo = NULL;
+ kms_bo_destroy(&ms->root_bo);
return TRUE;
}
@@ -904,6 +930,7 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn)
unsigned handle, stride;
struct kms_bo *bo;
unsigned attr[8];
+ int ret;
attr[0] = KMS_BO_TYPE;
attr[1] = KMS_BO_TYPE_SCANOUT;
@@ -922,14 +949,19 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn)
if (kms_bo_get_prop(bo, KMS_HANDLE, &handle))
goto err_destroy;
- drmModeAddFB(ms->fd,
- pScrn->virtualX,
- pScrn->virtualY,
- pScrn->depth,
- pScrn->bitsPerPixel,
- stride,
- handle,
- &ms->fb_id);
+ ret = drmModeAddFB(ms->fd,
+ pScrn->virtualX,
+ pScrn->virtualY,
+ pScrn->depth,
+ pScrn->bitsPerPixel,
+ stride,
+ handle,
+ &ms->fb_id);
+ if (ret) {
+ debug_printf("%s: failed to create framebuffer (%i, %s)",
+ __func__, ret, strerror(-ret));
+ goto err_destroy;
+ }
pScrn->frameX0 = 0;
pScrn->frameY0 = 0;
@@ -939,7 +971,7 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn)
return TRUE;
err_destroy:
- kms_bo_destroy(bo);
+ kms_bo_destroy(&bo);
return FALSE;
}
@@ -956,7 +988,7 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
return FALSE;
if (kms_bo_map(ms->root_bo, &ptr))
- return FALSE;
+ goto err_destroy;
pScreen->ModifyPixmapHeader(rootPixmap,
pScreen->width,
@@ -966,6 +998,10 @@ drv_bind_front_buffer_kms(ScrnInfoPtr pScrn)
stride,
ptr);
return TRUE;
+
+err_destroy:
+ kms_bo_destroy(&ms->root_bo);
+ return FALSE;
}
#endif /* HAVE_LIBKMS */
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index aa46cd45f1..d5c005ebad 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -43,6 +43,7 @@
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
+#include "util/u_format.h"
#include "util/u_rect.h"
#include "util/u_math.h"
#include "util/u_debug.h"
@@ -202,7 +203,7 @@ ExaDownloadFromScreen(PixmapPtr pPix, int x, int y, int w, int h, char *dst,
x, y, w, h, dst_pitch);
#endif
- util_copy_rect((unsigned char*)dst, &priv->tex->block, dst_pitch, 0, 0,
+ util_copy_rect((unsigned char*)dst, priv->tex->format, dst_pitch, 0, 0,
w, h, exa->scrn->transfer_map(exa->scrn, transfer),
transfer->stride, 0, 0);
@@ -242,7 +243,7 @@ ExaUploadToScreen(PixmapPtr pPix, int x, int y, int w, int h, char *src,
#endif
util_copy_rect(exa->scrn->transfer_map(exa->scrn, transfer),
- &priv->tex->block, transfer->stride, 0, 0, w, h,
+ priv->tex->format, transfer->stride, 0, 0, w, h,
(unsigned char*)src, src_pitch, 0, 0);
exa->scrn->transfer_unmap(exa->scrn, transfer);
@@ -343,6 +344,9 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
#if DEBUG_PRINT
debug_printf("ExaPrepareSolid(0x%x)\n", fg);
#endif
+ if (!exa->accel)
+ return FALSE;
+
if (!exa->pipe)
XORG_FALLBACK("accle not enabled");
@@ -361,7 +365,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
XORG_FALLBACK("format %s", pf_name(priv->tex->format));
}
- return exa->accel && xorg_solid_bind_state(exa, priv, fg);
+ return xorg_solid_bind_state(exa, priv, fg);
}
static void
@@ -417,6 +421,10 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
#if DEBUG_PRINT
debug_printf("ExaPrepareCopy\n");
#endif
+
+ if (!exa->accel)
+ return FALSE;
+
if (!exa->pipe)
XORG_FALLBACK("accle not enabled");
@@ -490,7 +498,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
}
- return exa->accel;
+ return TRUE;
}
static void
@@ -598,15 +606,19 @@ ExaCheckComposite(int op,
ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa;
- boolean accelerated = xorg_composite_accelerated(op,
- pSrcPicture,
- pMaskPicture,
- pDstPicture);
+
#if DEBUG_PRINT
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
#endif
- return exa->accel && accelerated;
+
+ if (!exa->accel)
+ return FALSE;
+
+ return xorg_composite_accelerated(op,
+ pSrcPicture,
+ pMaskPicture,
+ pDstPicture);
}
@@ -620,6 +632,9 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
struct exa_context *exa = ms->exa;
struct exa_pixmap_priv *priv;
+ if (!exa->accel)
+ return FALSE;
+
#if DEBUG_PRINT
debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n",
op, pSrcPicture, pMaskPicture, pDstPicture);
@@ -678,8 +693,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
render_format_name(pMaskPicture->format));
}
- return exa->accel &&
- xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
+ return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
pDstPicture,
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
pMask ? exaGetPixmapDriverPrivate(pMask) : NULL,
@@ -899,7 +913,6 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
memset(&template, 0, sizeof(template));
template.target = PIPE_TEXTURE_2D;
exa_get_pipe_format(depth, &template.format, &bitsPerPixel, &priv->picture_format);
- pf_get_block(template.format, &template.block);
if (ROUND_UP_TEXTURES && priv->flags == 0) {
template.width0 = util_next_power_of_two(width);
template.height0 = util_next_power_of_two(height);
@@ -985,7 +998,6 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn,
memset(&template, 0, sizeof(template));
template.target = PIPE_TEXTURE_2D;
exa_get_pipe_format(depth, &template.format, &bitsPerPixel, &dummy);
- pf_get_block(template.format, &template.block);
template.width0 = width;
template.height0 = height;
template.depth0 = 1;
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index f777395100..ba15f8a784 100644
--- a/src/gallium/state_trackers/xorg/xorg_renderer.c
+++ b/src/gallium/state_trackers/xorg/xorg_renderer.c
@@ -5,6 +5,7 @@
#include "cso_cache/cso_context.h"
#include "util/u_draw_quad.h"
+#include "util/u_format.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_rect.h"
@@ -512,7 +513,6 @@ renderer_clone_texture(struct xorg_renderer *r,
templ.width0 = src->width0;
templ.height0 = src->height0;
templ.depth0 = 1;
- pf_get_block(format, &templ.block);
templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
pt = screen->texture_create(screen, &templ);
diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h
index c6c7b2fe15..c0cfbe6061 100644
--- a/src/gallium/state_trackers/xorg/xorg_tracker.h
+++ b/src/gallium/state_trackers/xorg/xorg_tracker.h
@@ -114,6 +114,13 @@ typedef struct _modesettingRec
Bool noEvict;
Bool debug_fallback;
+ /* winsys hocks */
+ Bool (*winsys_screen_init)(ScrnInfoPtr pScr);
+ Bool (*winsys_screen_close)(ScrnInfoPtr pScr);
+ Bool (*winsys_enter_vt)(ScrnInfoPtr pScr);
+ Bool (*winsys_leave_vt)(ScrnInfoPtr pScr);
+ void *winsys_priv;
+
#ifdef DRM_MODE_FEATURE_DIRTYFB
DamagePtr damage;
#endif
diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index b8eca8c817..6b5a41a372 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -13,6 +13,8 @@
#include "pipe/p_screen.h"
#include "pipe/p_inlines.h"
+#include "util/u_format.h"
+
/*XXX get these from pipe's texture limits */
#define IMAGE_MAX_WIDTH 2048
#define IMAGE_MAX_HEIGHT 2048
@@ -170,7 +172,6 @@ create_component_texture(struct pipe_context *pipe,
templ.width0 = width;
templ.height0 = height;
templ.depth0 = 1;
- pf_get_block(PIPE_FORMAT_L8_UNORM, &templ.block);
templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
tex = screen->texture_create(screen, &templ);
@@ -213,17 +214,67 @@ check_yuv_textures(struct xorg_xv_port_priv *priv, int width, int height)
return Success;
}
+static int
+query_image_attributes(ScrnInfoPtr pScrn,
+ int id,
+ unsigned short *w, unsigned short *h,
+ int *pitches, int *offsets)
+{
+ int size, tmp;
+
+ if (*w > IMAGE_MAX_WIDTH)
+ *w = IMAGE_MAX_WIDTH;
+ if (*h > IMAGE_MAX_HEIGHT)
+ *h = IMAGE_MAX_HEIGHT;
+
+ *w = (*w + 1) & ~1;
+ if (offsets)
+ offsets[0] = 0;
+
+ switch (id) {
+ case FOURCC_YV12:
+ *h = (*h + 1) & ~1;
+ size = (*w + 3) & ~3;
+ if (pitches) {
+ pitches[0] = size;
+ }
+ size *= *h;
+ if (offsets) {
+ offsets[1] = size;
+ }
+ tmp = ((*w >> 1) + 3) & ~3;
+ if (pitches) {
+ pitches[1] = pitches[2] = tmp;
+ }
+ tmp *= (*h >> 1);
+ size += tmp;
+ if (offsets) {
+ offsets[2] = size;
+ }
+ size += tmp;
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ size = *w << 1;
+ if (pitches)
+ pitches[0] = size;
+ size *= *h;
+ break;
+ }
+
+ return size;
+}
+
static void
copy_packed_data(ScrnInfoPtr pScrn,
struct xorg_xv_port_priv *port,
int id,
unsigned char *buf,
- int srcPitch,
int left,
int top,
- int w, int h)
+ unsigned short w, unsigned short h)
{
- unsigned char *src;
int i, j;
struct pipe_texture **dst = port->yuv[port->current_set];
struct pipe_transfer *ytrans, *utrans, *vtrans;
@@ -233,8 +284,6 @@ copy_packed_data(ScrnInfoPtr pScrn,
int yidx, uidx, vidx;
int y_array_size = w * h;
- src = buf + (top * srcPitch) + (left << 1);
-
ytrans = screen->get_tex_transfer(screen, dst[0],
0, 0, 0,
PIPE_TRANSFER_WRITE,
@@ -256,15 +305,22 @@ copy_packed_data(ScrnInfoPtr pScrn,
switch (id) {
case FOURCC_YV12: {
- for (i = 0; i < w; ++i) {
- for (j = 0; j < h; ++j) {
- /*XXX use src? */
- y1 = buf[j*w + i];
- u = buf[(j/2) * (w/2) + i/2 + y_array_size];
- v = buf[(j/2) * (w/2) + i/2 + y_array_size + y_array_size/4];
- ymap[yidx++] = y1;
- umap[uidx++] = u;
- vmap[vidx++] = v;
+ int pitches[3], offsets[3];
+ unsigned char *y, *u, *v;
+ query_image_attributes(pScrn, FOURCC_YV12,
+ &w, &h, pitches, offsets);
+
+ y = buf + offsets[0];
+ v = buf + offsets[1];
+ u = buf + offsets[2];
+ for (i = 0; i < h; ++i) {
+ for (j = 0; j < w; ++j) {
+ int yoffset = (w*i+j);
+ int ii = (i|1), jj = (j|1);
+ int vuoffset = (w/2)*(ii/2) + (jj/2);
+ ymap[yidx++] = y[yoffset];
+ umap[uidx++] = u[vuoffset];
+ vmap[vidx++] = v[vuoffset];
}
}
}
@@ -511,7 +567,6 @@ put_image(ScrnInfoPtr pScrn,
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
PixmapPtr pPixmap;
INT32 x1, x2, y1, y2;
- int srcPitch;
BoxRec dstBox;
int ret;
@@ -530,21 +585,12 @@ put_image(ScrnInfoPtr pScrn,
width, height))
return Success;
- switch (id) {
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- case FOURCC_YV12:
- default:
- srcPitch = width << 1;
- break;
- }
-
ret = check_yuv_textures(pPriv, width, height);
if (ret)
return ret;
- copy_packed_data(pScrn, pPriv, id, buf, srcPitch,
+ copy_packed_data(pScrn, pPriv, id, buf,
src_x, src_y, width, height);
if (pDraw->type == DRAWABLE_WINDOW) {
@@ -562,38 +608,6 @@ put_image(ScrnInfoPtr pScrn,
return Success;
}
-static int
-query_image_attributes(ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets)
-{
- int size;
-
- if (*w > IMAGE_MAX_WIDTH)
- *w = IMAGE_MAX_WIDTH;
- if (*h > IMAGE_MAX_HEIGHT)
- *h = IMAGE_MAX_HEIGHT;
-
- *w = (*w + 1) & ~1;
- if (offsets)
- offsets[0] = 0;
-
- switch (id) {
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- case FOURCC_YV12:
- default:
- size = *w << 1;
- if (pitches)
- pitches[0] = size;
- size *= *h;
- break;
- }
-
- return size;
-}
-
static struct xorg_xv_port_priv *
port_priv_create(struct xorg_renderer *r)
{
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index 8cb73f4897..0e39a390c6 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2009 Younes Manton.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,7 +22,7 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
#include <assert.h>
@@ -106,7 +106,6 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u
template.width0 = width;
template.height0 = height;
template.depth0 = 1;
- pf_get_block(template.format, &template.block);
template.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
tex = vpipe->screen->texture_create(vpipe->screen, &template);