208 lines
5.4 KiB
Diff
208 lines
5.4 KiB
Diff
From d0b22a2fba91f5050aafdf41293f574875309f2d Mon Sep 17 00:00:00 2001
|
|
From: Dave Airlie <airlied@redhat.com>
|
|
Date: Mon, 24 Sep 2012 09:17:35 +1000
|
|
Subject: [PATCH] Revert "gbm: Use libkms to replace DRI cursor images"
|
|
|
|
This reverts commit a669a5055eadae85ffa000cea19a2241d0699348.
|
|
---
|
|
configure.ac | 2 --
|
|
src/egl/drivers/dri2/Makefile.am | 1 -
|
|
src/gbm/Makefile.am | 3 +-
|
|
src/gbm/backends/dri/gbm_dri.c | 65 +++++++--------------------------------
|
|
src/gbm/backends/dri/gbm_driint.h | 8 -----
|
|
5 files changed, 12 insertions(+), 67 deletions(-)
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 8badb72..2a3e766 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -1217,8 +1217,6 @@ if test "x$enable_gbm" = xyes; then
|
|
if test "x$enable_shared_glapi" = xno; then
|
|
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
|
|
fi
|
|
- PKG_CHECK_MODULES([LIBKMS], [libkms], [],
|
|
- AC_MSG_ERROR([gbm needs libkms]))
|
|
fi
|
|
fi
|
|
GBM_PC_REQ_PRIV="libudev"
|
|
diff --git a/src/egl/drivers/dri2/Makefile.am b/src/egl/drivers/dri2/Makefile.am
|
|
index 45f7dfa..49ec06b 100644
|
|
--- a/src/egl/drivers/dri2/Makefile.am
|
|
+++ b/src/egl/drivers/dri2/Makefile.am
|
|
@@ -30,7 +30,6 @@ AM_CFLAGS = \
|
|
$(DEFINES) \
|
|
$(LIBDRM_CFLAGS) \
|
|
$(LIBUDEV_CFLAGS) \
|
|
- $(LIBKMS_CFLAGS) \
|
|
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"
|
|
|
|
noinst_LTLIBRARIES = libegl_dri2.la
|
|
diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
|
|
index e22c55c..f079da1 100644
|
|
--- a/src/gbm/Makefile.am
|
|
+++ b/src/gbm/Makefile.am
|
|
@@ -7,7 +7,6 @@ AM_CFLAGS = \
|
|
-I$(top_srcdir)/include \
|
|
-I$(top_srcdir)/src/gbm/main \
|
|
$(LIBUDEV_CFLAGS) \
|
|
- $(LIBKMS_CFLAGS) \
|
|
$(DLOPEN_CFLAGS) \
|
|
$(DEFINES)
|
|
|
|
@@ -19,7 +18,7 @@ libgbm_la_SOURCES = \
|
|
main/backend.c \
|
|
main/common.c
|
|
libgbm_la_LDFLAGS = -version-info 1:0
|
|
-libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(LIBKMS_LIBS) $(DLOPEN_LIBS)
|
|
+libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(DLOPEN_LIBS)
|
|
|
|
if HAVE_EGL_PLATFORM_WAYLAND
|
|
AM_CPPFLAGS = -DHAVE_WAYLAND_PLATFORM
|
|
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
|
|
index d8b1cc7..f66c965 100644
|
|
--- a/src/gbm/backends/dri/gbm_dri.c
|
|
+++ b/src/gbm/backends/dri/gbm_dri.c
|
|
@@ -299,21 +299,13 @@ gbm_dri_is_format_supported(struct gbm_device *gbm,
|
|
static int
|
|
gbm_dri_bo_write(struct gbm_bo *_bo, const void *buf, size_t count)
|
|
{
|
|
+ struct gbm_dri_device *dri = gbm_dri_device(_bo->gbm);
|
|
struct gbm_dri_bo *bo = gbm_dri_bo(_bo);
|
|
- void *ptr;
|
|
- int ret;
|
|
-
|
|
- if (bo->bo == NULL)
|
|
- return -1;
|
|
|
|
- ret = kms_bo_map(bo->bo, &ptr);
|
|
- if (ret < 0)
|
|
+ if (dri->image->base.version < 4)
|
|
return -1;
|
|
|
|
- memcpy(ptr, buf, count);
|
|
-
|
|
- kms_bo_unmap(bo->bo);
|
|
- return 0;
|
|
+ return dri->image->write(bo->image, buf, count);
|
|
}
|
|
|
|
static void
|
|
@@ -322,10 +314,7 @@ gbm_dri_bo_destroy(struct gbm_bo *_bo)
|
|
struct gbm_dri_device *dri = gbm_dri_device(_bo->gbm);
|
|
struct gbm_dri_bo *bo = gbm_dri_bo(_bo);
|
|
|
|
- if (bo->image != NULL)
|
|
- dri->image->destroyImage(bo->image);
|
|
- if (bo->bo != NULL)
|
|
- kms_bo_destroy(&bo->bo);
|
|
+ dri->image->destroyImage(bo->image);
|
|
free(bo);
|
|
}
|
|
|
|
@@ -454,6 +443,9 @@ gbm_dri_bo_create(struct gbm_device *gbm,
|
|
int dri_format;
|
|
unsigned dri_use = 0;
|
|
|
|
+ if (dri->image->base.version < 4 && (usage & GBM_BO_USE_WRITE))
|
|
+ return NULL;
|
|
+
|
|
bo = calloc(1, sizeof *bo);
|
|
if (bo == NULL)
|
|
return NULL;
|
|
@@ -462,33 +454,6 @@ gbm_dri_bo_create(struct gbm_device *gbm,
|
|
bo->base.base.width = width;
|
|
bo->base.base.height = height;
|
|
|
|
- if (usage & GBM_BO_USE_WRITE) {
|
|
- int ret;
|
|
- unsigned attrs[7] = {
|
|
- KMS_WIDTH, 64,
|
|
- KMS_HEIGHT, 64,
|
|
- KMS_BO_TYPE, KMS_BO_TYPE_SCANOUT_X8R8G8B8,
|
|
- KMS_TERMINATE_PROP_LIST,
|
|
- };
|
|
-
|
|
- if (!(usage & GBM_BO_USE_CURSOR_64X64))
|
|
- return NULL;
|
|
-
|
|
- if (dri->kms == NULL)
|
|
- return NULL;
|
|
-
|
|
- ret = kms_bo_create(dri->kms, attrs, &bo->bo);
|
|
- if (ret < 0) {
|
|
- free(bo);
|
|
- return NULL;
|
|
- }
|
|
-
|
|
- kms_bo_get_prop(bo->bo, KMS_PITCH, &bo->base.base.stride);
|
|
- kms_bo_get_prop(bo->bo, KMS_HANDLE, (unsigned*)&bo->base.base.handle);
|
|
-
|
|
- return &bo->base.base;
|
|
- }
|
|
-
|
|
switch (format) {
|
|
case GBM_FORMAT_RGB565:
|
|
dri_format =__DRI_IMAGE_FORMAT_RGB565;
|
|
@@ -594,21 +559,13 @@ dri_device_create(int fd)
|
|
dri->base.type = GBM_DRM_DRIVER_TYPE_DRI;
|
|
dri->base.base.name = "drm";
|
|
|
|
- kms_create(fd, &dri->kms);
|
|
- if (dri->kms == NULL)
|
|
- goto err_kms;
|
|
-
|
|
ret = dri_screen_create(dri);
|
|
- if (ret)
|
|
- goto err_dri;
|
|
+ if (ret) {
|
|
+ free(dri);
|
|
+ return NULL;
|
|
+ }
|
|
|
|
return &dri->base.base;
|
|
-
|
|
-err_dri:
|
|
- kms_destroy(&dri->kms);
|
|
-err_kms:
|
|
- free(dri);
|
|
- return NULL;
|
|
}
|
|
|
|
struct gbm_backend gbm_dri_backend = {
|
|
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
|
|
index 4b619a0..f404368 100644
|
|
--- a/src/gbm/backends/dri/gbm_driint.h
|
|
+++ b/src/gbm/backends/dri/gbm_driint.h
|
|
@@ -30,8 +30,6 @@
|
|
|
|
#include "gbmint.h"
|
|
|
|
-#include "libkms.h"
|
|
-
|
|
#include "common.h"
|
|
#include "common_drm.h"
|
|
|
|
@@ -43,9 +41,6 @@ struct gbm_dri_surface;
|
|
struct gbm_dri_device {
|
|
struct gbm_drm_device base;
|
|
|
|
- /* Only used for cursors */
|
|
- struct kms_driver *kms;
|
|
-
|
|
void *driver;
|
|
|
|
__DRIscreen *screen;
|
|
@@ -77,9 +72,6 @@ struct gbm_dri_bo {
|
|
struct gbm_drm_bo base;
|
|
|
|
__DRIimage *image;
|
|
-
|
|
- /* Only used for cursors */
|
|
- struct kms_bo *bo;
|
|
};
|
|
|
|
struct gbm_dri_surface {
|
|
--
|
|
1.7.12
|
|
|