hardware/intel/common/libva
修订版 | acf42fc19c8025c5842314e89b5a103132827176 (tree) |
---|---|
时间 | 2010-03-31 14:21:43 |
作者 | Austin Yuan <shengquan.yuan@gmai...> |
Commiter | Austin Yuan |
Display *x11_dpy ==> void *native_dpy for other window system
Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
@@ -382,7 +382,7 @@ struct VADriverContext | ||
382 | 382 | void *pDriverData; |
383 | 383 | struct VADriverVTable vtable; |
384 | 384 | |
385 | - Display *x11_dpy; | |
385 | + void *native_dpy; | |
386 | 386 | int x11_screen; |
387 | 387 | int version_major; |
388 | 388 | int version_minor; |
@@ -62,12 +62,12 @@ dri1Close(VADriverContextP ctx) | ||
62 | 62 | struct dri_state *dri_state = (struct dri_state *)ctx->dri_state; |
63 | 63 | |
64 | 64 | free_drawable_hashtable(ctx); |
65 | - VA_DRIDestroyContext(ctx->x11_dpy, ctx->x11_screen, dri_state->hwContextID); | |
65 | + VA_DRIDestroyContext((Display *)ctx->native_dpy, ctx->x11_screen, dri_state->hwContextID); | |
66 | 66 | assert(dri_state->pSAREA != MAP_FAILED); |
67 | 67 | drmUnmap(dri_state->pSAREA, SAREA_MAX); |
68 | 68 | assert(dri_state->fd >= 0); |
69 | 69 | drmCloseOnce(dri_state->fd); |
70 | - VA_DRICloseConnection(ctx->x11_dpy, ctx->x11_screen); | |
70 | + VA_DRICloseConnection((Display *)ctx->native_dpy, ctx->x11_screen); | |
71 | 71 | } |
72 | 72 | |
73 | 73 | Bool |
@@ -87,7 +87,7 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name) | ||
87 | 87 | dri_state->pSAREA = MAP_FAILED; |
88 | 88 | dri_state->driConnectedFlag = VA_NONE; |
89 | 89 | |
90 | - if (!VA_DRIQueryDirectRenderingCapable(ctx->x11_dpy, | |
90 | + if (!VA_DRIQueryDirectRenderingCapable((Display *)ctx->native_dpy, | |
91 | 91 | ctx->x11_screen, |
92 | 92 | &direct_capable)) |
93 | 93 | goto err_out0; |
@@ -95,12 +95,12 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name) | ||
95 | 95 | if (!direct_capable) |
96 | 96 | goto err_out0; |
97 | 97 | |
98 | - if (!VA_DRIGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, | |
98 | + if (!VA_DRIGetClientDriverName((Display *)ctx->native_dpy, ctx->x11_screen, | |
99 | 99 | &driver_major, &driver_minor, |
100 | 100 | &driver_patch, driver_name)) |
101 | 101 | goto err_out0; |
102 | 102 | |
103 | - if (!VA_DRIOpenConnection(ctx->x11_dpy, ctx->x11_screen, | |
103 | + if (!VA_DRIOpenConnection((Display *)ctx->native_dpy, ctx->x11_screen, | |
104 | 104 | &dri_state->hSAREA, &BusID)) |
105 | 105 | goto err_out0; |
106 | 106 |
@@ -115,14 +115,14 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name) | ||
115 | 115 | if (drmGetMagic(dri_state->fd, &magic)) |
116 | 116 | goto err_out1; |
117 | 117 | |
118 | - if (newlyopened && !VA_DRIAuthConnection(ctx->x11_dpy, ctx->x11_screen, magic)) | |
118 | + if (newlyopened && !VA_DRIAuthConnection((Display *)ctx->native_dpy, ctx->x11_screen, magic)) | |
119 | 119 | goto err_out1; |
120 | 120 | |
121 | 121 | if (drmMap(dri_state->fd, dri_state->hSAREA, SAREA_MAX, &dri_state->pSAREA)) |
122 | 122 | goto err_out1; |
123 | 123 | |
124 | - if (!VA_DRICreateContext(ctx->x11_dpy, ctx->x11_screen, | |
125 | - DefaultVisual(ctx->x11_dpy, ctx->x11_screen), | |
124 | + if (!VA_DRICreateContext((Display *)ctx->native_dpy, ctx->x11_screen, | |
125 | + DefaultVisual((Display *)ctx->native_dpy, ctx->x11_screen), | |
126 | 126 | &dri_state->hwContextID, &dri_state->hwContext)) |
127 | 127 | goto err_out1; |
128 | 128 |
@@ -142,7 +142,7 @@ err_out1: | ||
142 | 142 | if (dri_state->fd >= 0) |
143 | 143 | drmCloseOnce(dri_state->fd); |
144 | 144 | |
145 | - VA_DRICloseConnection(ctx->x11_dpy, ctx->x11_screen); | |
145 | + VA_DRICloseConnection((Display *)ctx->native_dpy, ctx->x11_screen); | |
146 | 146 | |
147 | 147 | err_out0: |
148 | 148 | if (*driver_name) |
@@ -48,7 +48,7 @@ dri2CreateDrawable(VADriverContextP ctx, XID x_drawable) | ||
48 | 48 | dri2_drawable->base.x_drawable = x_drawable; |
49 | 49 | dri2_drawable->base.x = 0; |
50 | 50 | dri2_drawable->base.y = 0; |
51 | - VA_DRI2CreateDrawable(ctx->x11_dpy, x_drawable); | |
51 | + VA_DRI2CreateDrawable((Display *)ctx->native_dpy, x_drawable); | |
52 | 52 | |
53 | 53 | return &dri2_drawable->base; |
54 | 54 | } |
@@ -56,7 +56,7 @@ dri2CreateDrawable(VADriverContextP ctx, XID x_drawable) | ||
56 | 56 | static void |
57 | 57 | dri2DestroyDrawable(VADriverContextP ctx, struct dri_drawable *dri_drawable) |
58 | 58 | { |
59 | - VA_DRI2DestroyDrawable(ctx->x11_dpy, dri_drawable->x_drawable); | |
59 | + VA_DRI2DestroyDrawable((Display *)ctx->native_dpy, dri_drawable->x_drawable); | |
60 | 60 | free(dri_drawable); |
61 | 61 | } |
62 | 62 |
@@ -73,10 +73,10 @@ dri2SwapBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) | ||
73 | 73 | xrect.width = dri2_drawable->width; |
74 | 74 | xrect.height = dri2_drawable->height; |
75 | 75 | |
76 | - region = XFixesCreateRegion(ctx->x11_dpy, &xrect, 1); | |
77 | - VA_DRI2CopyRegion(ctx->x11_dpy, dri_drawable->x_drawable, region, | |
76 | + region = XFixesCreateRegion((Display *)ctx->native_dpy, &xrect, 1); | |
77 | + VA_DRI2CopyRegion((Display *)ctx->native_dpy, dri_drawable->x_drawable, region, | |
78 | 78 | DRI2BufferFrontLeft, DRI2BufferBackLeft); |
79 | - XFixesDestroyRegion(ctx->x11_dpy, region); | |
79 | + XFixesDestroyRegion((Display *)ctx->native_dpy, region); | |
80 | 80 | } |
81 | 81 | } |
82 | 82 |
@@ -92,7 +92,7 @@ dri2GetRenderingBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable) | ||
92 | 92 | i = 0; |
93 | 93 | attachments[i++] = __DRI_BUFFER_BACK_LEFT; |
94 | 94 | attachments[i++] = __DRI_BUFFER_FRONT_LEFT; |
95 | - buffers = VA_DRI2GetBuffers(ctx->x11_dpy, dri_drawable->x_drawable, | |
95 | + buffers = VA_DRI2GetBuffers((Display *)ctx->native_dpy, dri_drawable->x_drawable, | |
96 | 96 | &dri2_drawable->width, &dri2_drawable->height, |
97 | 97 | attachments, i, &count); |
98 | 98 | assert(buffers); |
@@ -149,14 +149,14 @@ isDRI2Connected(VADriverContextP ctx, char **driver_name) | ||
149 | 149 | *driver_name = NULL; |
150 | 150 | dri_state->fd = -1; |
151 | 151 | dri_state->driConnectedFlag = VA_NONE; |
152 | - if (!VA_DRI2QueryExtension(ctx->x11_dpy, &event_base, &error_base)) | |
152 | + if (!VA_DRI2QueryExtension((Display *)ctx->native_dpy, &event_base, &error_base)) | |
153 | 153 | goto err_out; |
154 | 154 | |
155 | - if (!VA_DRI2QueryVersion(ctx->x11_dpy, &major, &minor)) | |
155 | + if (!VA_DRI2QueryVersion((Display *)ctx->native_dpy, &major, &minor)) | |
156 | 156 | goto err_out; |
157 | 157 | |
158 | 158 | |
159 | - if (!VA_DRI2Connect(ctx->x11_dpy, RootWindow(ctx->x11_dpy, ctx->x11_screen), | |
159 | + if (!VA_DRI2Connect((Display *)ctx->native_dpy, RootWindow((Display *)ctx->native_dpy, ctx->x11_screen), | |
160 | 160 | driver_name, &device_name)) |
161 | 161 | goto err_out; |
162 | 162 |
@@ -169,7 +169,7 @@ isDRI2Connected(VADriverContextP ctx, char **driver_name) | ||
169 | 169 | if (drmGetMagic(dri_state->fd, &magic)) |
170 | 170 | goto err_out; |
171 | 171 | |
172 | - if (!VA_DRI2Authenticate(ctx->x11_dpy, RootWindow(ctx->x11_dpy, ctx->x11_screen), | |
172 | + if (!VA_DRI2Authenticate((Display *)ctx->native_dpy, RootWindow((Display *)ctx->native_dpy, ctx->x11_screen), | |
173 | 173 | magic)) |
174 | 174 | goto err_out; |
175 | 175 |
@@ -116,12 +116,12 @@ static VAStatus va_NVCTRL_GetDriverName ( | ||
116 | 116 | int direct_capable, driver_major, driver_minor, driver_patch; |
117 | 117 | Bool result; |
118 | 118 | |
119 | - result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen, | |
119 | + result = VA_NVCTRLQueryDirectRenderingCapable((Display *)ctx->native_dpy, ctx->x11_screen, | |
120 | 120 | &direct_capable); |
121 | 121 | if (!result || !direct_capable) |
122 | 122 | return VA_STATUS_ERROR_UNKNOWN; |
123 | 123 | |
124 | - result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, | |
124 | + result = VA_NVCTRLGetClientDriverName((Display *)ctx->native_dpy, ctx->x11_screen, | |
125 | 125 | &driver_major, &driver_minor, |
126 | 126 | &driver_patch, driver_name); |
127 | 127 | if (!result) |
@@ -172,7 +172,7 @@ VADisplay vaGetDisplay ( | ||
172 | 172 | while (pDisplayContext) |
173 | 173 | { |
174 | 174 | if (pDisplayContext->pDriverContext && |
175 | - pDisplayContext->pDriverContext->x11_dpy == native_dpy) | |
175 | + pDisplayContext->pDriverContext->native_dpy == (void *)native_dpy) | |
176 | 176 | { |
177 | 177 | dpy = (VADisplay)pDisplayContext; |
178 | 178 | break; |
@@ -192,7 +192,7 @@ VADisplay vaGetDisplay ( | ||
192 | 192 | { |
193 | 193 | pDisplayContext->vadpy_magic = VA_DISPLAY_MAGIC; |
194 | 194 | |
195 | - pDriverContext->x11_dpy = native_dpy; | |
195 | + pDriverContext->native_dpy = (void *)native_dpy; | |
196 | 196 | pDisplayContext->pNext = pDisplayContexts; |
197 | 197 | pDisplayContext->pDriverContext = pDriverContext; |
198 | 198 | pDisplayContext->vaIsValid = va_DisplayContextIsValid; |