Rev 4401 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4401 | Rev 4548 | ||
---|---|---|---|
Line 172... | Line 172... | ||
172 | 172 | ||
173 | static int |
173 | static int |
174 | dri_load_driver(struct gbm_dri_device *dri) |
174 | dri_load_driver(struct gbm_dri_device *dri) |
175 | { |
175 | { |
176 | const __DRIextension **extensions; |
- | |
177 | // char path[PATH_MAX], *search_paths, *p, *next, *end; |
176 | const __DRIextension **extensions; |
Line 178... | Line 177... | ||
178 | char *search_paths; |
177 | char path[64]; |
Line 179... | Line -... | ||
179 | - | ||
180 | search_paths = NULL; |
- | |
181 | - | ||
182 | #if 0 |
- | |
183 | - | ||
184 | if (geteuid() == getuid()) { |
- | |
185 | /* don't allow setuid apps to use GBM_DRIVERS_PATH */ |
- | |
186 | search_paths = getenv("GBM_DRIVERS_PATH"); |
- | |
187 | } |
- | |
188 | if (search_paths == NULL) |
- | |
189 | search_paths = DEFAULT_DRIVER_DIR; |
- | |
190 | - | ||
191 | dri->driver = NULL; |
- | |
192 | end = search_paths + strlen(search_paths); |
- | |
193 | for (p = search_paths; p < end && dri->driver == NULL; p = next + 1) { |
- | |
194 | int len; |
- | |
195 | next = strchr(p, ':'); |
- | |
196 | if (next == NULL) |
- | |
197 | next = end; |
- | |
198 | - | ||
199 | len = next - p; |
- | |
200 | #if GLX_USE_TLS |
- | |
201 | snprintf(path, sizeof path, |
- | |
202 | "%.*s/tls/%s_dri.so", len, p, dri->base.driver_name); |
- | |
203 | dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL); |
- | |
204 | #endif |
- | |
205 | if (dri->driver == NULL) { |
- | |
206 | snprintf(path, sizeof path, |
- | |
207 | "%.*s/%s_dri.so", len, p, dri->base.driver_name); |
- | |
208 | dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL); |
- | |
209 | if (dri->driver == NULL) |
- | |
210 | fprintf(stderr, "failed to open %s: %s\n", path, dlerror()); |
- | |
211 | } |
- | |
212 | } |
178 | |
Line 213... | Line 179... | ||
213 | #endif |
179 | snprintf(path, sizeof path,"/kolibrios/lib/%s_dri.drv", dri->base.driver_name); |
214 | 180 | ||
215 | dri->driver = load_library("libGL.dll"); |
181 | dri->driver = load_library(path); |
216 | 182 | ||
217 | if (dri->driver == NULL) { |
183 | if (dri->driver == NULL) { |
Line 218... | Line 184... | ||
218 | fprintf(stderr, "gbm: failed to open any driver (search paths %s)", |
184 | fprintf(stderr, "gbm: failed to open any driver (search paths %s)", |
219 | search_paths); |
185 | path); |
Line 241... | Line 207... | ||
241 | dri_screen_create(struct gbm_dri_device *dri) |
207 | dri_screen_create(struct gbm_dri_device *dri) |
242 | { |
208 | { |
243 | const __DRIextension **extensions; |
209 | const __DRIextension **extensions; |
244 | int ret = 0; |
210 | int ret = 0; |
Line 245... | Line 211... | ||
245 | 211 | ||
246 | dri->base.driver_name = strdup("drm"); //dri_fd_get_driver_name(dri->base.base.fd); |
212 | dri->base.driver_name = dri_fd_get_driver_name(dri->base.base.fd); |
247 | if (dri->base.driver_name == NULL) |
213 | if (dri->base.driver_name == NULL) |
Line 248... | Line 214... | ||
248 | return -1; |
214 | return -1; |
249 | 215 | ||
Line 586... | Line 552... | ||
586 | dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_HANDLE, |
552 | dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_HANDLE, |
587 | &bo->base.base.handle.s32); |
553 | &bo->base.base.handle.s32); |
588 | dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_STRIDE, |
554 | dri->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_STRIDE, |
589 | (int *) &bo->base.base.stride); |
555 | (int *) &bo->base.base.stride); |
Line 590... | Line -... | ||
590 | - | ||
591 | printf("%s handle %d w %d h%d\n",__FUNCTION__, bo->base.base.handle.s32, |
- | |
592 | width, height); |
- | |
593 | 556 | ||
594 | return &bo->base.base; |
557 | return &bo->base.base; |
Line 595... | Line 558... | ||
595 | } |
558 | } |
596 | 559 |