[openchrome-devel] xf86-video-openchrome: Branch 'main' - 7 commits - configure.ac src/drmmode_display.c src/drmmode_display.h src/Makefile.am src/via_driver.c src/via_driver.h src/via_kms.c src/via_kms.h src/via_ums.c src/via_xv.c
Kevin Brace
kevinbrace at kemper.freedesktop.org
Mon Aug 17 16:01:02 UTC 2020
configure.ac | 2 -
src/Makefile.am | 8 +++----
src/drmmode_display.c | 54 ++++++++++++--------------------------------------
src/drmmode_display.h | 10 +++++----
src/via_driver.c | 17 +--------------
src/via_driver.h | 3 +-
src/via_ums.c | 12 ++++++++++-
src/via_xv.c | 34 +++++++++++++++++++++++++++++++
8 files changed, 74 insertions(+), 66 deletions(-)
New commits:
commit 2f097aff0919b38e4d9b648d5bd6c17fd8e6d4df
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:59:40 2020 -0700
Version bumped to 0.6.303
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 8d7038b..3b3e081 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-openchrome],
- [0.6.302],
+ [0.6.303],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
[xf86-video-openchrome])
commit f4371b46c69adf4d953e5823c888260d2a9ec07f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:59:31 2020 -0700
Rename via_kms.h to drmmode_display.h
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index 87e3d3c..d8cbe11 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -82,11 +82,11 @@ openchrome_drv_la_SOURCES = \
if DRI
openchrome_drv_la_SOURCES += \
drmmode_display.c \
+ drmmode_display.h \
via_dri.c \
via_dri.h \
via_drm.h \
via_drmclient.h \
- via_kms.h \
via_xvmc.c \
via_xvmc.h \
drm_fourcc.h \
@@ -94,11 +94,11 @@ openchrome_drv_la_SOURCES += \
else
EXTRA_DIST += \
drmmode_display.c \
+ drmmode_display.h \
via_dri.c \
via_dri.h \
via_drm.h \
via_drmclient.h \
- via_kms.h \
via_xvmc.c \
via_xvmc.h \
drm_fourcc.h \
diff --git a/src/via_kms.h b/src/drmmode_display.h
similarity index 100%
rename from src/via_kms.h
rename to src/drmmode_display.h
diff --git a/src/via_driver.h b/src/via_driver.h
index 7d188bd..3d9ddb1 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -70,7 +70,7 @@
#include "via_memmgr.h"
#include "via_regs.h"
-#include "via_kms.h"
+#include "drmmode_display.h"
#include "via_ums.h"
#include "via_dmabuffer.h"
#include "via_3d.h"
commit 1903ee1daf7db495bf99dedf69bf7c2d997dd1da
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:59:20 2020 -0700
Rename via_kms.c to drmmode_display.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index 3db8adc..87e3d3c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -81,24 +81,24 @@ openchrome_drv_la_SOURCES = \
if DRI
openchrome_drv_la_SOURCES += \
+ drmmode_display.c \
via_dri.c \
via_dri.h \
via_drm.h \
via_drmclient.h \
via_kms.h \
- via_kms.c \
via_xvmc.c \
via_xvmc.h \
drm_fourcc.h \
openchrome_drm.h
else
EXTRA_DIST += \
+ drmmode_display.c \
via_dri.c \
via_dri.h \
via_drm.h \
via_drmclient.h \
via_kms.h \
- via_kms.c \
via_xvmc.c \
via_xvmc.h \
drm_fourcc.h \
diff --git a/src/via_kms.c b/src/drmmode_display.c
similarity index 100%
rename from src/via_kms.c
rename to src/drmmode_display.c
commit 4940b2321dc8f39692d88b65e9b570403966609c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:59:00 2020 -0700
Revert KMSCrtcInit() back to drmmode_pre_init()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_driver.c b/src/via_driver.c
index 94237d1..0faa349 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1145,7 +1145,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
if (pVia->KMS) {
- if (!KMSCrtcInit(pScrn, &pVia->drmmode)) {
+ if (!drmmode_pre_init(pScrn, &pVia->drmmode)) {
goto fail;
}
} else {
diff --git a/src/via_kms.c b/src/via_kms.c
index 8bde1e9..59bb43e 100644
--- a/src/via_kms.c
+++ b/src/via_kms.c
@@ -764,13 +764,11 @@ xf86CrtcConfigFuncsRec via_xf86crtc_config_funcs = {
via_xf86crtc_resize
};
-Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
+Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
{
int i;
Bool ret;
- DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "KMSCrtcInit\n"));
-
xf86CrtcConfigInit(pScrn, &via_xf86crtc_config_funcs);
drmmode->scrn = pScrn;
diff --git a/src/via_kms.h b/src/via_kms.h
index c63d499..4c2f322 100644
--- a/src/via_kms.h
+++ b/src/via_kms.h
@@ -84,7 +84,10 @@ typedef struct {
} drmmode_output_private_rec, *drmmode_output_private_ptr;
#endif
-extern Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
+
+extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
+
extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
+
#endif
commit 1bd183b9d7527fb395778ccc6aa8af765e594e69
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:58:49 2020 -0700
Handle CRTC and display initialization calls outside of VIAPreInit()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_driver.c b/src/via_driver.c
index b767a5f..94237d1 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -677,7 +677,7 @@ viaConvertDepthToBpp(int bpp, int depth)
return bppSize;
}
-static Bool
+Bool
via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -826,11 +826,6 @@ fail:
return FALSE;
}
-static const
-xf86CrtcConfigFuncsRec via_xf86crtc_config_funcs = {
- via_xf86crtc_resize
-};
-
static Bool
VIAPreInit(ScrnInfoPtr pScrn, int flags)
{
@@ -1149,9 +1144,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
- /* CRTC handling */
- xf86CrtcConfigInit(pScrn, &via_xf86crtc_config_funcs);
-
if (pVia->KMS) {
if (!KMSCrtcInit(pScrn, &pVia->drmmode)) {
goto fail;
@@ -1162,11 +1154,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
- if (!xf86InitialConfiguration(pScrn, TRUE)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initial configuration failed\n");
- goto fail;
- }
-
if (!pScrn->modes) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
goto fail;
diff --git a/src/via_driver.h b/src/via_driver.h
index 011ede7..7d188bd 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -359,6 +359,7 @@ typedef struct
const OptionInfoRec *VIAAvailableOptions(int chipid, int busid);
void viaSetupDefaultOptions(ScrnInfoPtr pScrn);
void viaProcessOptions(ScrnInfoPtr pScrn);
+Bool via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
/* In via_exa.c. */
int viaEXAOffscreenAlloc(ScrnInfoPtr pScrn,
diff --git a/src/via_kms.c b/src/via_kms.c
index fb44808..8bde1e9 100644
--- a/src/via_kms.c
+++ b/src/via_kms.c
@@ -759,12 +759,20 @@ drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
}
}
+static const
+xf86CrtcConfigFuncsRec via_xf86crtc_config_funcs = {
+ via_xf86crtc_resize
+};
+
Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
{
int i;
+ Bool ret;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "KMSCrtcInit\n"));
+ xf86CrtcConfigInit(pScrn, &via_xf86crtc_config_funcs);
+
drmmode->scrn = pScrn;
drmmode->mode_res = drmModeGetResources(drmmode->fd);
if (!drmmode->mode_res)
@@ -780,7 +788,9 @@ Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
/* workout clones */
drmmode_clones_init(pScrn, drmmode);
- return TRUE;
+ ret = xf86InitialConfiguration(pScrn, TRUE);
+
+ return ret;
}
#ifdef HAVE_LIBUDEV
diff --git a/src/via_ums.c b/src/via_ums.c
index 309d1c3..006425e 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -29,6 +29,11 @@
#include "globals.h"
#include "via_driver.h"
+static const
+xf86CrtcConfigFuncsRec via_xf86crtc_config_funcs = {
+ via_xf86crtc_resize
+};
+
static void
viaMMIOEnable(ScrnInfoPtr pScrn)
{
@@ -1217,6 +1222,7 @@ viaUMSCrtcInit(ScrnInfoPtr pScrn)
int max_pitch, max_height;
xf86CrtcPtr iga1, iga2;
uint32_t i;
+ Bool ret;
vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL);
@@ -1427,6 +1433,8 @@ viaUMSCrtcInit(ScrnInfoPtr pScrn)
clockRanges->doubleScanAllowed = FALSE;
pScrn->clockRanges = clockRanges;
+ xf86CrtcConfigInit(pScrn, &via_xf86crtc_config_funcs);
+
/*
* Now handle the outputs
*/
@@ -1491,5 +1499,7 @@ viaUMSCrtcInit(ScrnInfoPtr pScrn)
viaInitDisplay(pScrn);
- return TRUE;
+ ret = xf86InitialConfiguration(pScrn, TRUE);
+
+ return ret;
}
commit ca78e9a517a0a5d77734946acf22e1a717ef323c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:58:32 2020 -0700
Use HAVE_LIBUDEV instead of HAVE_UDEV
It probably was a programming mistake.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_kms.c b/src/via_kms.c
index a9e0286..fb44808 100644
--- a/src/via_kms.c
+++ b/src/via_kms.c
@@ -783,7 +783,7 @@ Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
return TRUE;
}
-#ifdef HAVE_UDEV
+#ifdef HAVE_LIBUDEV
static void
drmmode_handle_uevents(int fd, void *closure)
{
@@ -802,7 +802,7 @@ drmmode_handle_uevents(int fd, void *closure)
void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
{
-#ifdef HAVE_UDEV
+#ifdef HAVE_LIBUDEV
struct udev_monitor *mon;
struct udev *u;
@@ -832,7 +832,7 @@ void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode)
{
-#ifdef HAVE_UDEV
+#ifdef HAVE_LIBUDEV
if (drmmode->uevent_handler) {
struct udev *u = udev_monitor_get_udev(drmmode->uevent_monitor);
diff --git a/src/via_kms.h b/src/via_kms.h
index 2c93843..c63d499 100644
--- a/src/via_kms.h
+++ b/src/via_kms.h
@@ -30,7 +30,7 @@
#ifdef HAVE_DRI
#include "xf86drmMode.h"
#endif
-#ifdef HAVE_UDEV
+#ifdef HAVE_LIBUDEV
#include "libudev.h"
#endif
@@ -43,7 +43,7 @@ typedef struct {
drmEventContext event_context;
#endif
ScrnInfoPtr scrn;
-#ifdef HAVE_UDEV
+#ifdef HAVE_LIBUDEV
struct udev_monitor *uevent_monitor;
InputHandlerProc uevent_handler;
#endif
commit d269cab9669b062954c7671f85d55608598d4887
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon Aug 17 08:58:15 2020 -0700
Move window_belongs_to_crtc() from via_kms.c to via_xv.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_kms.c b/src/via_kms.c
index f414656..a9e0286 100644
--- a/src/via_kms.c
+++ b/src/via_kms.c
@@ -50,40 +50,6 @@
#include <X11/extensions/dpms.h>
#endif
-xf86CrtcPtr
-window_belongs_to_crtc(ScrnInfoPtr pScrn, int x, int y, int w, int h)
-{
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- int largest = 0, area = 0, i;
- BoxRec crtc_area, overlap;
- xf86CrtcPtr best = NULL;
-
- for (i = 0; i < xf86_config->num_crtc; i++) {
- xf86CrtcPtr crtc = xf86_config->crtc[i];
-
- if (crtc->enabled) {
- crtc_area.x1 = crtc->x;
- crtc_area.x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
- crtc_area.y1 = crtc->y;
- crtc_area.y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
- overlap.x1 = crtc_area.x1 > x ? crtc_area.x1 : x;
- overlap.x2 = crtc_area.x2 < x + w ? crtc_area.x2 : x + w;
- overlap.y1 = crtc_area.y1 > y ? crtc_area.y1 : y;
- overlap.y2 = crtc_area.y2 < y ? crtc_area.y2 : y + h;
-
- if (overlap.x1 >= overlap.x2 || overlap.y1 >= overlap.y2)
- overlap.x1 = overlap.x2 = overlap.y1 = overlap.y2 = 0;
-
- area = (overlap.x2 - overlap.x1) * (overlap.y2 - overlap.y1);
- if (area > largest) {
- area = largest;
- best = crtc;
- }
- }
- }
- return best;
-}
-
static void
drmmode_ConvertFromKMode(ScrnInfoPtr pScrn, drmModeModeInfo *kmode,
DisplayModePtr mode)
diff --git a/src/via_kms.h b/src/via_kms.h
index 2085f62..2c93843 100644
--- a/src/via_kms.h
+++ b/src/via_kms.h
@@ -84,7 +84,6 @@ typedef struct {
} drmmode_output_private_rec, *drmmode_output_private_ptr;
#endif
-extern xf86CrtcPtr window_belongs_to_crtc(ScrnInfoPtr pScrn, int x, int y, int w, int h);
extern Bool KMSCrtcInit(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
diff --git a/src/via_xv.c b/src/via_xv.c
index 8d2823a..bccce55 100644
--- a/src/via_xv.c
+++ b/src/via_xv.c
@@ -255,6 +255,40 @@ static unsigned numAdaptPort[XV_ADAPT_NUM] = { 1 };
* F U N C T I O N
*/
+static xf86CrtcPtr
+window_belongs_to_crtc(ScrnInfoPtr pScrn, int x, int y, int w, int h)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int largest = 0, area = 0, i;
+ BoxRec crtc_area, overlap;
+ xf86CrtcPtr best = NULL;
+
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+ if (crtc->enabled) {
+ crtc_area.x1 = crtc->x;
+ crtc_area.x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
+ crtc_area.y1 = crtc->y;
+ crtc_area.y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
+ overlap.x1 = crtc_area.x1 > x ? crtc_area.x1 : x;
+ overlap.x2 = crtc_area.x2 < x + w ? crtc_area.x2 : x + w;
+ overlap.y1 = crtc_area.y1 > y ? crtc_area.y1 : y;
+ overlap.y2 = crtc_area.y2 < y ? crtc_area.y2 : y + h;
+
+ if (overlap.x1 >= overlap.x2 || overlap.y1 >= overlap.y2)
+ overlap.x1 = overlap.x2 = overlap.y1 = overlap.y2 = 0;
+
+ area = (overlap.x2 - overlap.x1) * (overlap.y2 - overlap.y1);
+ if (area > largest) {
+ area = largest;
+ best = crtc;
+ }
+ }
+ }
+ return best;
+}
+
/*
* Decide if the mode support video overlay. This depends on the bandwidth
* of the mode and the type of RAM available.
More information about the openchrome-devel
mailing list