This patch renames that fields to have consistent names.
if (es->geometry.x != output->base.x ||
es->geometry.y != output->base.y ||
buffer == NULL || c->gbm == NULL ||
- buffer->width != output->base.current->width ||
- buffer->height != output->base.current->height ||
+ buffer->width != output->base.current_mode->width ||
+ buffer->height != output->base.current_mode->height ||
output->base.transform != es->buffer_transform ||
es->transform.enabled)
return NULL;
if (!output->next)
return;
- mode = container_of(output->base.current, struct drm_mode, base);
+ mode = container_of(output->base.current_mode, struct drm_mode, base);
if (!output->current) {
ret = drmModeSetCrtc(compositor->drm.fd, output->crtc_id,
output->next->fb_id, 0, 0,
if (es->buffer_transform != output_base->transform)
return NULL;
- if (es->buffer_scale != output_base->scale)
+ if (es->buffer_scale != output_base->current_scale)
return NULL;
if (c->sprites_are_broken)
tbox = weston_transformed_rect(output_base->width,
output_base->height,
output_base->transform,
- output_base->scale,
+ output_base->current_scale,
*box);
s->dest_x = tbox.x1;
s->dest_y = tbox.y1;
}
}
- x = (es->geometry.x - output->base.x) * output->base.scale;
- y = (es->geometry.y - output->base.y) * output->base.scale;
+ x = (es->geometry.x - output->base.x) * output->base.current_scale;
+ y = (es->geometry.y - output->base.y) * output->base.current_scale;
if (output->cursor_plane.x != x || output->cursor_plane.y != y) {
if (drmModeMoveCursor(c->drm.fd, output->crtc_id, x, y)) {
weston_log("failed to move cursor: %m\n");
{
struct drm_mode *tmp_mode = NULL, *mode;
- if (output->base.current->width == target_mode->width &&
- output->base.current->height == target_mode->height &&
- (output->base.current->refresh == target_mode->refresh ||
+ if (output->base.current_mode->width == target_mode->width &&
+ output->base.current_mode->height == target_mode->height &&
+ (output->base.current_mode->refresh == target_mode->refresh ||
target_mode->refresh == 0))
- return (struct drm_mode *)output->base.current;
+ return (struct drm_mode *)output->base.current_mode;
wl_list_for_each(mode, &output->base.mode_list, base.link) {
if (mode->mode_info.hdisplay == target_mode->width &&
return -1;
}
- if (&drm_mode->base == output->base.current)
+ if (&drm_mode->base == output->base.current_mode)
return 0;
- output->base.current->flags = 0;
+ output->base.current_mode->flags = 0;
- output->base.current = &drm_mode->base;
- output->base.current->flags =
+ output->base.current_mode = &drm_mode->base;
+ output->base.current_mode->flags =
WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
/* reset rendering stuff. */
int i, flags;
output->surface = gbm_surface_create(ec->gbm,
- output->base.current->width,
- output->base.current->height,
+ output->base.current_mode->width,
+ output->base.current_mode->height,
GBM_FORMAT_XRGB8888,
GBM_BO_USE_SCANOUT |
GBM_BO_USE_RENDERING);
static int
drm_output_init_pixman(struct drm_output *output, struct drm_compositor *c)
{
- int w = output->base.current->width;
- int h = output->base.current->height;
+ int w = output->base.current_mode->width;
+ int h = output->base.current_mode->height;
unsigned int i;
/* FIXME error checking */
configured = current;
if (option_current_mode && current)
- output->base.current = ¤t->base;
+ output->base.current_mode = ¤t->base;
else if (configured)
- output->base.current = &configured->base;
+ output->base.current_mode = &configured->base;
else if (preferred)
- output->base.current = &preferred->base;
+ output->base.current_mode = &preferred->base;
else if (current)
- output->base.current = ¤t->base;
+ output->base.current_mode = ¤t->base;
- if (output->base.current == NULL) {
+ if (output->base.current_mode == NULL) {
weston_log("no available modes for %s\n", output->base.name);
goto err_free;
}
- output->base.current->flags |= WL_OUTPUT_MODE_CURRENT;
+ output->base.current_mode->flags |= WL_OUTPUT_MODE_CURRENT;
weston_output_init(&output->base, &ec->base, x, y,
connector->mmWidth, connector->mmHeight,
if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
output->base.connection_internal = 1;
- output->base.origin = output->base.current;
+ output->base.original_mode = output->base.current_mode;
output->base.start_repaint_loop = drm_output_start_repaint_loop;
output->base.repaint = drm_output_repaint;
output->base.destroy = drm_output_destroy;
continue;
}
- drm_mode = (struct drm_mode *) output->base.current;
+ drm_mode = (struct drm_mode *) output->base.current_mode;
ret = drmModeSetCrtc(compositor->drm.fd, output->crtc_id,
output->current->fb_id, 0, 0,
&output->connector_id, 1,
struct drm_output, base.link);
if (!output->recorder) {
- width = output->base.current->width;
- height = output->base.current->height;
+ width = output->base.current_mode->width;
+ height = output->base.current_mode->height;
output->recorder =
create_recorder(c, width, height, "capture.h264");
wl_list_init(&output->base.mode_list);
wl_list_insert(&output->base.mode_list, &output->mode.link);
- output->base.current = &output->mode;
- output->base.origin = &output->mode;
+ output->base.current_mode = &output->mode;
+ output->base.original_mode = &output->mode;
output->base.subpixel = WL_OUTPUT_SUBPIXEL_UNKNOWN;
output->base.make = "unknown";
output->base.model = output->fb_info.id;
wl_list_init(&output->base.mode_list);
wl_list_insert(&output->base.mode_list, &output->mode.link);
- output->base.current = &output->mode;
+ output->base.current_mode = &output->mode;
weston_output_init(&output->base, &c->base, 0, 0, width, height,
WL_OUTPUT_TRANSFORM_NORMAL, 1);
output->finish_frame_timer =
wl_event_loop_add_timer(loop, finish_frame_handler, output);
- output->base.origin = output->base.current;
+ output->base.original_mode = output->base.current_mode;
output->base.start_repaint_loop = headless_output_start_repaint_loop;
output->base.repaint = headless_output_repaint;
output->base.destroy = headless_output_destroy;
return -ENOENT;
}
- if(local_mode == output->current)
+ if(local_mode == output->current_mode)
return 0;
- output->current->flags = 0;
- output->current = local_mode;
- output->current->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
+ output->current_mode->flags = 0;
+ output->current_mode = local_mode;
+ output->current_mode->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
pixman_renderer_output_destroy(output);
pixman_renderer_output_create(output);
goto out_free_output_and_modes;
}
- output->base.current = currentMode;
+ output->base.current_mode = currentMode;
weston_output_init(&output->base, &c->base, 0, 0, width, height,
WL_OUTPUT_TRANSFORM_NORMAL, 1);
loop = wl_display_get_event_loop(c->base.wl_display);
output->finish_frame_timer = wl_event_loop_add_timer(loop, finish_frame_handler, output);
- output->base.origin = output->base.current;
+ output->base.original_mode = output->base.current_mode;
output->base.start_repaint_loop = rdp_output_start_repaint_loop;
output->base.repaint = rdp_output_repaint;
output->base.destroy = rdp_output_destroy;
wl_list_init(&output->base.mode_list);
wl_list_insert(&output->base.mode_list, &output->mode.link);
- output->base.current = &output->mode;
- output->base.origin = &output->mode;
+ output->base.current_mode = &output->mode;
+ output->base.original_mode = &output->mode;
output->base.subpixel = WL_OUTPUT_SUBPIXEL_UNKNOWN;
output->base.make = "unknown";
output->base.model = "unknown";
wl_list_init(&output->base.mode_list);
wl_list_insert(&output->base.mode_list, &output->mode.link);
- output->base.current = &output->mode;
+ output->base.current_mode = &output->mode;
weston_output_init(&output->base, &c->base, 0, 0, width, height,
WL_OUTPUT_TRANSFORM_NORMAL, 1);
&shell_surface_listener, output);
wl_shell_surface_set_toplevel(output->parent.shell_surface);
- output->base.origin = output->base.current;
+ output->base.original_mode = output->base.current_mode;
output->base.start_repaint_loop = wayland_output_start_repaint_loop;
output->base.repaint = wayland_output_repaint;
output->base.destroy = wayland_output_destroy;
break;
}
- transformed_rect.x1 *= output_base->scale;
- transformed_rect.y1 *= output_base->scale;
- transformed_rect.x2 *= output_base->scale;
- transformed_rect.y2 *= output_base->scale;
+ transformed_rect.x1 *= output_base->current_scale;
+ transformed_rect.y1 *= output_base->current_scale;
+ transformed_rect.x2 *= output_base->current_scale;
+ transformed_rect.y2 *= output_base->current_scale;
output_rects[i].x = transformed_rect.x1;
output_rects[i].y = transformed_rect.y1;
output->base.set_backlight = NULL;
output->base.set_dpms = NULL;
output->base.switch_mode = NULL;
- output->base.current = &output->mode;
- output->base.origin = output->base.current;
+ output->base.current_mode = &output->mode;
+ output->base.original_mode = output->base.current_mode;
output->base.make = "xwayland";
output->base.model = "none";
weston_output_init(&output->base, &c->base,
if (ret < 0)
return ret;
- output->scale = scale;
+ output->current_scale = scale;
pixman_region32_init(&old_output_region);
pixman_region32_copy(&old_output_region, &output->region);
/* Update output region and transformation matrix */
- weston_output_transform_scale_init(output, output->transform, output->scale);
+ weston_output_transform_scale_init(output, output->transform, output->current_scale);
pixman_region32_init(&output->previous_damage);
pixman_region32_init_rect(&output->region, output->x, output->y,
output->transform);
if (version >= 2)
wl_output_send_scale(resource,
- output->scale);
+ output->current_scale);
wl_list_for_each (mode, &output->mode_list, link) {
wl_output_send_mode(resource,
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
/* Swap width and height */
- output->width = output->current->height;
- output->height = output->current->width;
+ output->width = output->current_mode->height;
+ output->height = output->current_mode->width;
break;
case WL_OUTPUT_TRANSFORM_NORMAL:
case WL_OUTPUT_TRANSFORM_180:
case WL_OUTPUT_TRANSFORM_FLIPPED:
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
- output->width = output->current->width;
- output->height = output->current->height;
+ output->width = output->current_mode->width;
+ output->height = output->current_mode->height;
break;
default:
break;
}
- output->scale = scale;
+ output->current_scale = scale;
output->width /= scale;
output->height /= scale;
}
output->mm_width = mm_width;
output->mm_height = mm_height;
output->dirty = 1;
- output->origin_scale = scale;
+ output->original_scale = scale;
weston_output_transform_scale_init(output, transform, scale);
weston_output_init_zoom(output);
wl_fixed_t tx, ty;
wl_fixed_t width, height;
- width = wl_fixed_from_int(output->width * output->scale - 1);
- height = wl_fixed_from_int(output->height * output->scale - 1);
+ width = wl_fixed_from_int(output->width * output->current_scale - 1);
+ height = wl_fixed_from_int(output->height * output->current_scale - 1);
switch(output->transform) {
case WL_OUTPUT_TRANSFORM_NORMAL:
break;
}
- *x = tx / output->scale + wl_fixed_from_int(output->x);
- *y = ty / output->scale + wl_fixed_from_int(output->y);
+ *x = tx / output->current_scale + wl_fixed_from_int(output->x);
+ *y = ty / output->current_scale + wl_fixed_from_int(output->y);
}
static void
char *make, *model, *serial_number;
uint32_t subpixel;
uint32_t transform;
- int32_t scale;
+ int32_t current_scale;
- struct weston_mode *current;
- struct weston_mode *origin;
- int32_t origin_scale;
+ struct weston_mode *current_mode;
+ struct weston_mode *original_mode;
+ int32_t original_scale;
struct wl_list mode_list;
void (*start_repaint_loop)(struct weston_output *output);
static void
evdev_process_touch(struct evdev_device *device, struct input_event *e)
{
- const int screen_width = device->output->current->width;
- const int screen_height = device->output->current->height;
+ const int screen_width = device->output->current_mode->width;
+ const int screen_height = device->output->current_mode->height;
switch (e->code) {
case ABS_MT_SLOT:
evdev_process_absolute_motion(struct evdev_device *device,
struct input_event *e)
{
- const int screen_width = device->output->current->width;
- const int screen_height = device->output->current->height;
+ const int screen_width = device->output->current_mode->width;
+ const int screen_height = device->output->current_mode->height;
switch (e->code) {
case ABS_X:
use_shader(gr, gs->shader);
shader_uniforms(gs->shader, es, output);
- if (es->transform.enabled || output->zoom.active || output->scale != es->buffer_scale)
+ if (es->transform.enabled || output->zoom.active || output->current_scale != es->buffer_scale)
filter = GL_LINEAR;
else
filter = GL_NEAREST;
x[0] = -gr->border.left;
x[1] = 0;
- x[2] = output->current->width;
- x[3] = output->current->width + gr->border.right;
+ x[2] = output->current_mode->width;
+ x[3] = output->current_mode->width + gr->border.right;
y[0] = -gr->border.top;
y[1] = 0;
- y[2] = output->current->height;
- y[3] = output->current->height + gr->border.bottom;
+ y[2] = output->current_mode->height;
+ y[3] = output->current_mode->height + gr->border.bottom;
u[0] = 0.0;
u[1] = (GLfloat) gr->border.left / gr->border.width;
int32_t width, height;
pixman_region32_t buffer_damage, total_damage;
- width = output->current->width +
+ width = output->current_mode->width +
output->border.left + output->border.right;
- height = output->current->height +
+ height = output->current_mode->height +
output->border.top + output->border.bottom;
glViewport(0, 0, width, height);
{
pixman_region32_translate(region, -output->x, -output->y);
transform_region (region, output->width, output->height, output->transform);
- scale_region (region, output->scale);
+ scale_region (region, output->current_scale);
}
#define D2F(v) pixman_double_to_fixed((double)v)
specified buffer transform/scale */
pixman_transform_init_identity(&transform);
pixman_transform_scale(&transform, NULL,
- pixman_double_to_fixed ((double)1.0/output->scale),
- pixman_double_to_fixed ((double)1.0/output->scale));
+ pixman_double_to_fixed ((double)1.0/output->current_scale),
+ pixman_double_to_fixed ((double)1.0/output->current_scale));
fw = pixman_int_to_fixed(output->width);
fh = pixman_int_to_fixed(output->height);
pixman_image_set_transform(ps->image, &transform);
- if (es->transform.enabled || output->scale != es->buffer_scale)
+ if (es->transform.enabled || output->current_scale != es->buffer_scale)
pixman_image_set_filter(ps->image, PIXMAN_FILTER_BILINEAR, NULL, 0);
else
pixman_image_set_filter(ps->image, PIXMAN_FILTER_NEAREST, NULL, 0);
return -1;
/* set shadow image transformation */
- w = output->current->width;
- h = output->current->height;
+ w = output->current_mode->width;
+ h = output->current_mode->height;
po->shadow_buffer = malloc(w * h * 4);
uint32_t i;
int ret;
- fb_width = base->current->width;
- fb_height = base->current->height;
+ fb_width = base->current_mode->width;
+ fb_height = base->current_mode->height;
DBG("%s(%u, %u, %u, %u), resource %p\n", __func__,
x, y, width, height, buffer);
compositor->renderer->read_pixels(output,
compositor->read_format, pixels,
- 0, 0, output->current->width,
- output->current->height);
+ 0, 0, output->current_mode->width,
+ output->current_mode->height);
stride = wl_shm_buffer_get_stride(l->buffer->shm_buffer);
case PIXMAN_a8r8g8b8:
case PIXMAN_x8r8g8b8:
if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP)
- copy_bgra_yflip(d, s, output->current->height, stride);
+ copy_bgra_yflip(d, s, output->current_mode->height, stride);
else
- copy_bgra(d, pixels, output->current->height, stride);
+ copy_bgra(d, pixels, output->current_mode->height, stride);
break;
case PIXMAN_x8b8g8r8:
case PIXMAN_a8b8g8r8:
if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP)
- copy_rgba_yflip(d, s, output->current->height, stride);
+ copy_rgba_yflip(d, s, output->current_mode->height, stride);
else
- copy_rgba(d, pixels, output->current->height, stride);
+ copy_rgba(d, pixels, output->current_mode->height, stride);
break;
default:
break;
buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer);
buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer);
- if (buffer->width < output->current->width ||
- buffer->height < output->current->height)
+ if (buffer->width < output->current_mode->width ||
+ buffer->height < output->current_mode->height)
return;
l = malloc(sizeof *l);
break;
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- r->x1 = output->current->width - s.y2;
+ r->x1 = output->current_mode->width - s.y2;
r->y1 = s.x1;
- r->x2 = output->current->width - s.y1;
+ r->x2 = output->current_mode->width - s.y1;
r->y2 = s.x2;
break;
case WL_OUTPUT_TRANSFORM_180:
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
- r->x1 = output->current->width - s.x2;
- r->y1 = output->current->height - s.y2;
- r->x2 = output->current->width - s.x1;
- r->y2 = output->current->height - s.y1;
+ r->x1 = output->current_mode->width - s.x2;
+ r->y1 = output->current_mode->height - s.y2;
+ r->x2 = output->current_mode->width - s.x1;
+ r->y2 = output->current_mode->height - s.y1;
break;
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
r->x1 = s.y1;
- r->y1 = output->current->height - s.x2;
+ r->y1 = output->current_mode->height - s.x2;
r->x2 = s.y2;
- r->y2 = output->current->height - s.x1;
+ r->y2 = output->current_mode->height - s.x1;
break;
default:
break;
}
- r->x1 *= output->scale;
- r->y1 *= output->scale;
- r->x2 *= output->scale;
- r->y2 *= output->scale;
+ r->x1 *= output->current_scale;
+ r->y1 *= output->current_scale;
+ r->x2 *= output->current_scale;
+ r->y2 *= output->current_scale;
}
static void
v[1].iov_base = r;
v[1].iov_len = n * sizeof *r;
recorder->total += writev(recorder->fd, v, 2);
- stride = output->current->width;
+ stride = output->current_mode->width;
for (i = 0; i < n; i++) {
width = r[i].x2 - r[i].x1;
height = r[i].y2 - r[i].y1;
if (do_yflip)
- y_orig = output->current->height - r[i].y2;
+ y_orig = output->current_mode->height - r[i].y2;
else
y_orig = r[i].y1;
recorder = malloc(sizeof *recorder);
- stride = output->current->width;
- size = stride * 4 * output->current->height;
+ stride = output->current_mode->width;
+ size = stride * 4 * output->current_mode->height;
recorder->frame = zalloc(size);
recorder->rect = malloc(size);
recorder->total = 0;
return;
}
- header.width = output->current->width;
- header.height = output->current->height;
+ header.width = output->current_mode->width;
+ header.height = output->current_mode->height;
recorder->total += write(recorder->fd, &header, sizeof header);
recorder->frame_listener.notify = weston_recorder_frame_notify;