summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2012-01-12 15:02:07 (GMT)
committerDaniel Stone <daniels@collabora.com>2012-01-12 15:02:07 (GMT)
commit7e2e4e73d02f431c318f56009e2637a213ceb1db (patch)
tree6a82b06dbbba606422c9296064ef9bc1f7fcaadd
parentdebaff815c9b8f17062b84bc0294fa69a0570777 (diff)
downloadxf86-video-ti81xx-7e2e4e73d02f431c318f56009e2637a213ceb1db.tar.gz
xf86-video-ti81xx-7e2e4e73d02f431c318f56009e2637a213ceb1db.tar.xz
More buffer_ready cleanup
Signed-off-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--src/xv.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/xv.c b/src/xv.c
index f3b1099..f0143e1 100644
--- a/src/xv.c
+++ b/src/xv.c
@@ -334,37 +334,30 @@ void ti81xx_video_buffer_ready(ScrnInfoPtr xf86_screen,
struct drm_ti81xx_event_buffer_ready *event)
{
struct ti81xx_screen_priv *screen_priv = get_screen_priv(xf86_screen);
- struct ti81xx_video_priv *video_priv;
- struct ti81xx_buffer *buf;
+ struct ti81xx_video_priv *video_priv = get_video_priv(screen_priv, 0); /* XXX */
+ struct ti81xx_buffer *buf = NULL;
ClientPtr client;
uint32_t retire_fb_id = 0;
- int i, j;
-
- for (i = 0; i < screen_priv->num_video_ports; i++) {
- video_priv = get_video_priv(screen_priv, i);
- client = video_priv->dix_port->grab.client;
- if (client)
- break;
- }
+ int i;
/* We may have received a buffer ready event for one of our shadow child
* buffers. Find the buffer ID we should be sending to the client. */
- for (j = 0; j < TI81XX_VIDEO_NUM_CLIENT_BUFFERS; j++) {
+ for (i = 0; i < TI81XX_VIDEO_NUM_CLIENT_BUFFERS; i++) {
uint32_t fb_id;
- if (screen_priv->child_buffers[j])
- fb_id = screen_priv->child_buffers[j]->fb_id;
+ if (screen_priv->child_buffers[i])
+ fb_id = screen_priv->child_buffers[i]->fb_id;
else
- fb_id = screen_priv->client_buffers[j];
+ fb_id = screen_priv->client_buffers[i];
if (fb_id != event->fb_id)
continue;
- retire_fb_id = screen_priv->client_buffers[j];
- screen_priv->client_buffers[j] = 0;
- if (screen_priv->child_buffers[j]) {
- ti81xx_buffer_free(xf86_screen, screen_priv->child_buffers[j]);
- screen_priv->child_buffers[j] = NULL;
+ retire_fb_id = screen_priv->client_buffers[i];
+ screen_priv->client_buffers[i] = 0;
+ if (screen_priv->child_buffers[i]) {
+ ti81xx_buffer_free(xf86_screen, screen_priv->child_buffers[i]);
+ screen_priv->child_buffers[i] = NULL;
}
break;
@@ -375,16 +368,16 @@ void ti81xx_video_buffer_ready(ScrnInfoPtr xf86_screen,
/* If there are any more references to this buffer in the queue, don't send the
* ready event until they're all completed. */
- for (j = 0; j < TI81XX_VIDEO_NUM_CLIENT_BUFFERS; j++) {
- if (screen_priv->client_buffers[j] == retire_fb_id) {
+ for (i = 0; i < TI81XX_VIDEO_NUM_CLIENT_BUFFERS; i++) {
+ if (screen_priv->client_buffers[i] == retire_fb_id) {
return;
}
}
/* If this is an internal Xv buffer, rather than a client GEM buffer, put it
* back in the queue and return. */
- for (j = 0; j < TI81XX_VIDEO_NUM_BUFFERS; j++) {
- buf = video_priv->buffers.bufs[j];
+ for (i = 0; i < TI81XX_VIDEO_NUM_BUFFERS; i++) {
+ buf = video_priv->buffers.bufs[i];
if (!buf || buf->fb_id != retire_fb_id)
continue;
if (buf->status != BUFFER_STATUS_QUEUED) {
@@ -396,6 +389,7 @@ void ti81xx_video_buffer_ready(ScrnInfoPtr xf86_screen,
return;
}
+ client = video_priv->dix_port->grab.client;
if (!client)
return;