Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4401 → Rev 5080

/contrib/sdk/sources/Mesa/src/gallium/state_trackers/egl/drm/modeset.c
61,6 → 61,7
static boolean
drm_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back)
{
#if 0
struct drm_surface *drmsurf = drm_surface(nsurf);
struct drm_display *drmdpy = drmsurf->drmdpy;
int num_framebuffers = (need_back) ? 2 : 1;
115,6 → 116,8
}
 
return TRUE;
#endif
return FALSE;
}
 
static boolean
121,11 → 124,6
drm_surface_flush_frontbuffer(struct native_surface *nsurf)
{
#ifdef DRM_MODE_FEATURE_DIRTYFB
struct drm_surface *drmsurf = drm_surface(nsurf);
struct drm_display *drmdpy = drmsurf->drmdpy;
 
if (drmsurf->front_fb.is_passive)
drmModeDirtyFB(drmdpy->fd, drmsurf->front_fb.buffer_id, NULL, 0);
#endif
 
return TRUE;
153,6 → 151,7
static boolean
drm_surface_swap_buffers(struct native_surface *nsurf)
{
#if 0
struct drm_surface *drmsurf = drm_surface(nsurf);
struct drm_crtc *drmcrtc = &drmsurf->current_crtc;
struct drm_display *drmdpy = drmsurf->drmdpy;
187,6 → 186,7
drmsurf->sequence_number++;
drmdpy->event_handler->invalid_surface(&drmdpy->base,
&drmsurf->base, drmsurf->sequence_number);
#endif
 
return TRUE;
}
229,6 → 229,7
static void
drm_surface_destroy(struct native_surface *nsurf)
{
#if 0
struct drm_surface *drmsurf = drm_surface(nsurf);
 
resource_surface_wait(drmsurf->rsurf);
245,6 → 246,7
 
resource_surface_destroy(drmsurf->rsurf);
FREE(drmsurf);
#endif
}
 
static struct drm_surface *
332,7 → 334,7
{
struct drm_display *drmdpy = drm_display(ndpy);
int idx;
 
#if 0
for (idx = 0; idx < drmdpy->resources->count_crtcs; idx++) {
boolean found_crtc = TRUE;
int i, j;
377,6 → 379,8
}
 
return drmdpy->resources->crtcs[idx];
#endif
return 0;
}
 
/**
392,7 → 396,7
struct drm_crtc *drmcrtc = &drmdpy->saved_crtcs[crtc_idx];
uint32_t crtc_id;
int err;
 
#if 0
if (drmcrtc->crtc) {
crtc_id = drmcrtc->crtc->crtc_id;
}
441,6 → 445,9
}
 
return TRUE;
#endif
return FALSE;
 
}
 
static boolean
449,6 → 456,7
const struct native_connector **nconns, int num_nconns,
const struct native_mode *nmode)
{
#if 0
struct drm_display *drmdpy = drm_display(ndpy);
struct drm_surface *drmsurf = drm_surface(nsurf);
const struct drm_mode *drmmode = drm_mode(nmode);
512,6 → 520,9
}
 
return TRUE;
#endif
return FALSE;
 
}
 
static const struct native_mode **
519,6 → 530,7
const struct native_connector *nconn,
int *num_modes)
{
#if 0
struct drm_display *drmdpy = drm_display(ndpy);
struct drm_connector *drmconn = drm_connector(nconn);
const struct native_mode **nmodes_return;
572,6 → 584,8
}
 
return nmodes_return;
#endif
return NULL;
}
 
static const struct native_connector **
578,6 → 592,7
drm_display_get_connectors(struct native_display *ndpy, int *num_connectors,
int *num_crtc)
{
#if 0
struct drm_display *drmdpy = drm_display(ndpy);
const struct native_connector **connectors;
int i;
610,6 → 625,8
*num_crtc = drmdpy->resources->count_crtcs;
 
return connectors;
#endif
return NULL;
}
 
static struct native_surface *
633,6 → 650,7
void
drm_display_fini_modeset(struct native_display *ndpy)
{
#if 0
struct drm_display *drmdpy = drm_display(ndpy);
int i;
 
673,11 → 691,13
}
 
drmdpy->base.modeset = NULL;
#endif
}
 
boolean
drm_display_init_modeset(struct native_display *ndpy)
{
#if 0
struct drm_display *drmdpy = drm_display(ndpy);
 
/* resources are fixed, unlike crtc, connector, or encoder */
702,6 → 722,6
}
 
drmdpy->base.modeset = &drm_display_modeset;
 
#endif
return TRUE;
}
/contrib/sdk/sources/Mesa/src/gallium/state_trackers/egl/drm/native_drm.c
27,6 → 27,7
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <kos32sys.h>
 
#include "util/u_memory.h"
#include "egllog.h"
138,8 → 139,6
 
if (drmdpy->own_gbm) {
gbm_device_destroy(&drmdpy->gbmdrm->base.base);
if (drmdpy->fd >= 0)
close(drmdpy->fd);
}
 
FREE(drmdpy);
156,34 → 155,6
{
char *device_name = NULL;
#ifdef HAVE_LIBUDEV
struct udev *udev;
struct udev_device *device;
struct stat buf;
const char *tmp;
 
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "failed to stat fd %d", fd);
goto outudev;
}
 
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"could not create udev device for fd %d", fd);
goto outdevice;
}
 
tmp = udev_device_get_devnode(device);
if (!tmp)
goto outdevice;
device_name = strdup(tmp);
 
outdevice:
udev_device_unref(device);
outudev:
udev_unref(udev);
 
#endif
return device_name;
}
314,19 → 285,13
gbm = dpy;
 
if (gbm == NULL) {
const char *device_name="/dev/dri/card0";
#ifdef O_CLOEXEC
fd = open(device_name, O_RDWR | O_CLOEXEC);
if (fd == -1 && errno == EINVAL)
#endif
{
fd = open(device_name, O_RDWR);
if (fd != -1)
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
fd = get_service("DISPLAY");
if (fd == NULL)
return NULL;
 
/* FIXME: Use an internal constructor to create a gbm
* device with gallium backend directly, without setenv */
setenv("GBM_BACKEND", "gbm_gallium_drm.so", 1);
// setenv("GBM_BACKEND", "gbm_gallium_drm.so", 1);
gbm = gbm_gallium_drm_device(gbm_create_device(fd));
own_gbm = 1;
}