mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-21 06:01:43 +00:00
c/direct: Shorten displays member names.
This commit is contained in:
parent
29b771818e
commit
77207ed585
|
@ -37,12 +37,10 @@ struct comp_window_direct_nvidia
|
||||||
struct comp_window base;
|
struct comp_window base;
|
||||||
|
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
struct comp_window_direct_nvidia_display *nv_displays;
|
struct comp_window_direct_nvidia_display *displays;
|
||||||
uint16_t num_displays;
|
uint16_t num_displays;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Pre decalre functions
|
* Pre decalre functions
|
||||||
|
@ -102,13 +100,13 @@ comp_window_direct_nvidia_destroy(struct comp_window *w)
|
||||||
|
|
||||||
for (uint32_t i = 0; i < w_direct->num_displays; i++) {
|
for (uint32_t i = 0; i < w_direct->num_displays; i++) {
|
||||||
struct comp_window_direct_nvidia_display *d =
|
struct comp_window_direct_nvidia_display *d =
|
||||||
&w_direct->nv_displays[i];
|
&w_direct->displays[i];
|
||||||
d->display = VK_NULL_HANDLE;
|
d->display = VK_NULL_HANDLE;
|
||||||
free(d->name);
|
free(d->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w_direct->nv_displays != NULL)
|
if (w_direct->displays != NULL)
|
||||||
free(w_direct->nv_displays);
|
free(w_direct->displays);
|
||||||
|
|
||||||
if (w_direct->dpy) {
|
if (w_direct->dpy) {
|
||||||
XCloseDisplay(w_direct->dpy);
|
XCloseDisplay(w_direct->dpy);
|
||||||
|
@ -144,14 +142,14 @@ append_nvidia_entry_on_match(struct comp_window_direct_nvidia *w,
|
||||||
|
|
||||||
w->num_displays += 1;
|
w->num_displays += 1;
|
||||||
|
|
||||||
U_ARRAY_REALLOC_OR_FREE(w->nv_displays,
|
U_ARRAY_REALLOC_OR_FREE(w->displays,
|
||||||
struct comp_window_direct_nvidia_display,
|
struct comp_window_direct_nvidia_display,
|
||||||
w->num_displays);
|
w->num_displays);
|
||||||
|
|
||||||
if (w->nv_displays == NULL)
|
if (w->displays == NULL)
|
||||||
COMP_ERROR(w->base.c, "Unable to reallocate randr_displays");
|
COMP_ERROR(w->base.c, "Unable to reallocate randr_displays");
|
||||||
|
|
||||||
w->nv_displays[w->num_displays - 1] = d;
|
w->displays[w->num_displays - 1] = d;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -241,7 +239,7 @@ comp_window_direct_nvidia_current_display(struct comp_window_direct_nvidia *w)
|
||||||
if (w->num_displays <= (uint32_t)index)
|
if (w->num_displays <= (uint32_t)index)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return &w->nv_displays[index];
|
return &w->displays[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct comp_window_direct_randr
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
xcb_screen_t *screen;
|
xcb_screen_t *screen;
|
||||||
|
|
||||||
struct comp_window_direct_randr_display *randr_displays;
|
struct comp_window_direct_randr_display *displays;
|
||||||
|
|
||||||
uint16_t num_displays;
|
uint16_t num_displays;
|
||||||
};
|
};
|
||||||
|
@ -122,7 +122,7 @@ comp_window_direct_randr_destroy(struct comp_window *w)
|
||||||
|
|
||||||
for (uint32_t i = 0; i < w_direct->num_displays; i++) {
|
for (uint32_t i = 0; i < w_direct->num_displays; i++) {
|
||||||
struct comp_window_direct_randr_display *d =
|
struct comp_window_direct_randr_display *d =
|
||||||
&w_direct->randr_displays[i];
|
&w_direct->displays[i];
|
||||||
|
|
||||||
if (d->display == VK_NULL_HANDLE) {
|
if (d->display == VK_NULL_HANDLE) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -133,8 +133,8 @@ comp_window_direct_randr_destroy(struct comp_window *w)
|
||||||
free(d->name);
|
free(d->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w_direct->randr_displays != NULL)
|
if (w_direct->displays != NULL)
|
||||||
free(w_direct->randr_displays);
|
free(w_direct->displays);
|
||||||
|
|
||||||
if (w_direct->dpy) {
|
if (w_direct->dpy) {
|
||||||
XCloseDisplay(w_direct->dpy);
|
XCloseDisplay(w_direct->dpy);
|
||||||
|
@ -149,7 +149,7 @@ comp_window_direct_randr_list_screens(struct comp_window_direct_randr *w)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < w->num_displays; i++) {
|
for (int i = 0; i < w->num_displays; i++) {
|
||||||
const struct comp_window_direct_randr_display *d =
|
const struct comp_window_direct_randr_display *d =
|
||||||
&w->randr_displays[i];
|
&w->displays[i];
|
||||||
COMP_DEBUG(
|
COMP_DEBUG(
|
||||||
w->base.c, "%d: %s %dx%d@%.2f", i, d->name,
|
w->base.c, "%d: %s %dx%d@%.2f", i, d->name,
|
||||||
d->primary_mode.width, d->primary_mode.height,
|
d->primary_mode.width, d->primary_mode.height,
|
||||||
|
@ -227,7 +227,7 @@ comp_window_direct_randr_current_display(struct comp_window_direct_randr *w)
|
||||||
if (w->num_displays <= (uint32_t)index)
|
if (w->num_displays <= (uint32_t)index)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return &w->randr_displays[index];
|
return &w->displays[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -352,14 +352,14 @@ append_randr_display(struct comp_window_direct_randr *w,
|
||||||
|
|
||||||
w->num_displays += 1;
|
w->num_displays += 1;
|
||||||
|
|
||||||
U_ARRAY_REALLOC_OR_FREE(w->randr_displays,
|
U_ARRAY_REALLOC_OR_FREE(w->displays,
|
||||||
struct comp_window_direct_randr_display,
|
struct comp_window_direct_randr_display,
|
||||||
w->num_displays);
|
w->num_displays);
|
||||||
|
|
||||||
if (w->randr_displays == NULL)
|
if (w->displays == NULL)
|
||||||
COMP_ERROR(w->base.c, "Unable to reallocate randr_displays");
|
COMP_ERROR(w->base.c, "Unable to reallocate randr_displays");
|
||||||
|
|
||||||
w->randr_displays[w->num_displays - 1] = d;
|
w->displays[w->num_displays - 1] = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue