summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorŁukasz Spintzyk <lukasz.spintzyk@synaptics.com>2020-09-18 14:32:01 +0200
committerPovilas Kanapickas <povilas@radix.lt>2021-04-16 10:53:43 +0000
commit5be3b80b8d084ca5721be8791910d5827d1b6014 (patch)
treeb9c176f08ed4ad0bdac0f5c0d28a3cdf29da38ed /hw
parentc282be503e267afdd050df837d4cf61e0e7287b7 (diff)
modesetting: Remove few common functions from ms namespace
A lot of that code is the same as in xf86-amdgpu and xf86-nouveau drivers. By removing that functions from ms namespace we can move that code to common implementation. Signed-off-by: Łukasz Spintzyk <lukasz.spintzyk@synaptics.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/drivers/modesetting/dri2.c2
-rw-r--r--hw/xfree86/drivers/modesetting/driver.h2
-rw-r--r--hw/xfree86/drivers/modesetting/pageflip.c2
-rw-r--r--hw/xfree86/drivers/modesetting/present.c2
-rw-r--r--hw/xfree86/drivers/modesetting/vblank.c34
5 files changed, 21 insertions, 21 deletions
diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c
index e893da422..7ff52be6d 100644
--- a/hw/xfree86/drivers/modesetting/dri2.c
+++ b/hw/xfree86/drivers/modesetting/dri2.c
@@ -552,7 +552,7 @@ can_exchange(ScrnInfoPtr scrn, DrawablePtr draw,
return FALSE;
#endif
- if (ms_crtc_on(config->crtc[i]))
+ if (xf86_crtc_on(config->crtc[i]))
num_crtcs_on++;
}
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 77afc8302..114971048 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -200,7 +200,7 @@ void ms_drm_abort(ScrnInfoPtr scrn,
void *match_data);
void ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq);
-Bool ms_crtc_on(xf86CrtcPtr crtc);
+Bool xf86_crtc_on(xf86CrtcPtr crtc);
xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw);
RRCrtcPtr ms_randr_crtc_covering_drawable(DrawablePtr pDraw);
diff --git a/hw/xfree86/drivers/modesetting/pageflip.c b/hw/xfree86/drivers/modesetting/pageflip.c
index 9c199668f..aaa284bf6 100644
--- a/hw/xfree86/drivers/modesetting/pageflip.c
+++ b/hw/xfree86/drivers/modesetting/pageflip.c
@@ -313,7 +313,7 @@ ms_do_pageflip(ScreenPtr screen,
for (i = 0; i < config->num_crtc; i++) {
xf86CrtcPtr crtc = config->crtc[i];
- if (!ms_crtc_on(crtc))
+ if (!xf86_crtc_on(crtc))
continue;
if (!queue_flip_on_crtc(screen, crtc, flipdata,
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index 869a38c8e..f0a0e2704 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -259,7 +259,7 @@ ms_present_check_unflip(RRCrtcPtr crtc,
if (drmmode_crtc->rotate_bo.gbm)
return FALSE;
- if (ms_crtc_on(config->crtc[i]))
+ if (xf86_crtc_on(config->crtc[i]))
num_crtcs_on++;
}
diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c
index 25784777e..c8da476b5 100644
--- a/hw/xfree86/drivers/modesetting/vblank.c
+++ b/hw/xfree86/drivers/modesetting/vblank.c
@@ -49,7 +49,7 @@
static struct xorg_list ms_drm_queue;
static uint32_t ms_drm_seq;
-static void ms_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
+static void box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
{
dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
@@ -64,7 +64,7 @@ static void ms_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
}
-static void ms_randr_crtc_box(RRCrtcPtr crtc, BoxPtr crtc_box)
+static void rr_crtc_box(RRCrtcPtr crtc, BoxPtr crtc_box)
{
if (crtc->mode) {
crtc_box->x1 = crtc->x;
@@ -86,25 +86,25 @@ static void ms_randr_crtc_box(RRCrtcPtr crtc, BoxPtr crtc_box)
crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
}
-static int ms_box_area(BoxPtr box)
+static int box_area(BoxPtr box)
{
return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
}
-static Bool rr_crtc_on(RRCrtcPtr crtc, Bool crtc_is_ms_hint)
+static Bool rr_crtc_on(RRCrtcPtr crtc, Bool crtc_is_xf86_hint)
{
if (!crtc) {
return FALSE;
}
- if (crtc_is_ms_hint && crtc->devPrivate) {
- return ms_crtc_on(crtc->devPrivate);
+ if (crtc_is_xf86_hint && crtc->devPrivate) {
+ return xf86_crtc_on(crtc->devPrivate);
} else {
return !!crtc->mode;
}
}
Bool
-ms_crtc_on(xf86CrtcPtr crtc)
+xf86_crtc_on(xf86CrtcPtr crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -117,7 +117,7 @@ ms_crtc_on(xf86CrtcPtr crtc)
* 'box', then prefer the crtc with greater coverage.
*/
static RRCrtcPtr
-ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
+rr_crtc_covering_box(ScreenPtr pScreen, BoxPtr box, Bool screen_is_xf86_hint)
{
rrScrPrivPtr pScrPriv;
RRCrtcPtr crtc, best_crtc;
@@ -140,12 +140,12 @@ ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
crtc = pScrPriv->crtcs[c];
/* If the CRTC is off, treat it as not covering */
- if (!rr_crtc_on(crtc, screen_is_ms))
+ if (!rr_crtc_on(crtc, screen_is_xf86_hint))
continue;
- ms_randr_crtc_box(crtc, &crtc_box);
- ms_box_intersect(&cover_box, &crtc_box, box);
- coverage = ms_box_area(&cover_box);
+ rr_crtc_box(crtc, &crtc_box);
+ box_intersect(&cover_box, &crtc_box, box);
+ coverage = box_area(&cover_box);
if (coverage > best_coverage) {
best_crtc = crtc;
best_coverage = coverage;
@@ -156,7 +156,7 @@ ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
}
static RRCrtcPtr
-ms_covering_randr_crtc_on_secondary(ScreenPtr pScreen, BoxPtr box)
+rr_crtc_covering_box_on_secondary(ScreenPtr pScreen, BoxPtr box)
{
if (!pScreen->isGPU) {
ScreenPtr secondary;
@@ -166,7 +166,7 @@ ms_covering_randr_crtc_on_secondary(ScreenPtr pScreen, BoxPtr box)
if (!secondary->is_output_secondary)
continue;
- crtc = ms_covering_randr_crtc(secondary, box, FALSE);
+ crtc = rr_crtc_covering_box(secondary, box, FALSE);
if (crtc)
return crtc;
}
@@ -187,7 +187,7 @@ ms_dri2_crtc_covering_drawable(DrawablePtr pDraw)
box.x2 = box.x1 + pDraw->width;
box.y2 = box.y1 + pDraw->height;
- crtc = ms_covering_randr_crtc(pScreen, &box, TRUE);
+ crtc = rr_crtc_covering_box(pScreen, &box, TRUE);
if (crtc) {
return crtc->devPrivate;
}
@@ -206,9 +206,9 @@ ms_randr_crtc_covering_drawable(DrawablePtr pDraw)
box.x2 = box.x1 + pDraw->width;
box.y2 = box.y1 + pDraw->height;
- crtc = ms_covering_randr_crtc(pScreen, &box, TRUE);
+ crtc = rr_crtc_covering_box(pScreen, &box, TRUE);
if (!crtc) {
- crtc = ms_covering_randr_crtc_on_secondary(pScreen, &box);
+ crtc = rr_crtc_covering_box_on_secondary(pScreen, &box);
}
return crtc;
}