buffer->width != output->base.current->width ||
buffer->height != output->base.current->height ||
output->base.transform != es->buffer_transform ||
- output->base.scale != es->buffer_scale ||
es->transform.enabled)
return NULL;
}
static struct drm_mode *
-drm_output_add_mode(struct drm_output *output, drmModeModeInfo *info, int scale)
+drm_output_add_mode(struct drm_output *output, drmModeModeInfo *info)
{
struct drm_mode *mode;
uint64_t refresh;
if (mode == NULL)
return NULL;
- if (info->hdisplay % scale != 0 ||
- info->vdisplay % scale) {
- weston_log("Mode %dx%d not multiple of scale %d\n", info->hdisplay, info->vdisplay, scale);
- return NULL;
- }
-
mode->base.flags = 0;
- mode->base.width = info->hdisplay / scale;
- mode->base.height = info->vdisplay / scale;
+ mode->base.width = info->hdisplay;
+ mode->base.height = info->vdisplay;
/* Calculate higher precision (mHz) refresh rate */
refresh = (info->clock * 1000000LL / info->htotal +
mode->base.refresh = refresh;
mode->mode_info = *info;
- if (scale != 1)
- mode->base.flags |= WL_OUTPUT_MODE_SCALED;
-
if (info->type & DRM_MODE_TYPE_PREFERRED)
mode->base.flags |= WL_OUTPUT_MODE_PREFERRED;
int i, flags;
output->surface = gbm_surface_create(ec->gbm,
- output->base.current->width * output->base.scale,
- output->base.current->height * output->base.scale,
+ output->base.current->width,
+ output->base.current->height,
GBM_FORMAT_XRGB8888,
GBM_BO_USE_SCANOUT |
GBM_BO_USE_RENDERING);
/* FIXME error checking */
for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) {
- output->dumb[i] = drm_fb_create_dumb(c, w * output->base.scale, h * output->base.scale);
+ output->dumb[i] = drm_fb_create_dumb(c, w, h);
if (!output->dumb[i])
goto err;
output->image[i] =
- pixman_image_create_bits(PIXMAN_x8r8g8b8, w * output->base.scale, h * output->base.scale,
+ pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h,
output->dumb[i]->map,
output->dumb[i]->stride);
if (!output->image[i])
goto err;
pixman_region32_init_rect(&output->previous_damage,
- output->base.x, output->base.y, w, h);
+ output->base.x, output->base.y, output->base.width, output->base.height);
return 0;
}
for (i = 0; i < connector->count_modes; i++) {
- drm_mode = drm_output_add_mode(output,
- &connector->modes[i], scale);
+ drm_mode = drm_output_add_mode(output, &connector->modes[i]);
if (!drm_mode)
goto err_free;
}
wl_list_for_each(drm_mode, &output->base.mode_list, base.link) {
if (config == OUTPUT_CONFIG_MODE &&
- width == drm_mode->base.width * scale &&
- height == drm_mode->base.height * scale)
+ width == drm_mode->base.width &&
+ height == drm_mode->base.height)
configured = drm_mode;
if (!memcmp(&crtc_mode, &drm_mode->mode_info, sizeof crtc_mode))
current = drm_mode;
}
if (config == OUTPUT_CONFIG_MODELINE) {
- configured = drm_output_add_mode(output, &modeline, scale);
+ configured = drm_output_add_mode(output, &modeline);
if (!configured)
goto err_free;
}
if (current == NULL && crtc_mode.clock != 0) {
- current = drm_output_add_mode(output, &crtc_mode, scale);
+ current = drm_output_add_mode(output, &crtc_mode);
if (!current)
goto err_free;
}
output->mode.flags =
WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
- if (output->scale != 1)
- output->mode.flags |= WL_OUTPUT_MODE_SCALED;
- output->mode.width = width;
- output->mode.height = height;
+ output->mode.width = output_width;
+ output->mode.height = output_height;
output->mode.refresh = 60000;
output->scale = scale;
wl_list_init(&output->base.mode_list);
}
static void
-weston_output_transform_init(struct weston_output *output, uint32_t transform);
-static void
-weston_output_scale_init(struct weston_output *output, int32_t scale);
+weston_output_transform_scale_init(struct weston_output *output,
+ uint32_t transform, uint32_t scale);
WL_EXPORT int
weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode)
pixman_region32_copy(&old_output_region, &output->region);
/* Update output region and transformation matrix */
- weston_output_transform_init(output, output->transform);
- weston_output_scale_init(output, output->scale);
+ weston_output_transform_scale_init(output, output->transform, output->scale);
pixman_region32_init(&output->previous_damage);
pixman_region32_init_rect(&output->region, output->x, output->y,
}
static void
-weston_output_transform_init(struct weston_output *output, uint32_t transform)
+weston_output_transform_scale_init(struct weston_output *output, uint32_t transform, uint32_t scale)
{
output->transform = transform;
default:
break;
}
-}
-static void
-weston_output_scale_init(struct weston_output *output, int32_t scale)
-{
output->scale = scale;
+ output->width /= scale;
+ output->height /= scale;
}
WL_EXPORT void
WL_EXPORT void
weston_output_init(struct weston_output *output, struct weston_compositor *c,
- int x, int y, int width, int height, uint32_t transform,
+ int x, int y, int mm_width, int mm_height, uint32_t transform,
int32_t scale)
{
output->compositor = c;
output->border.bottom = 0;
output->border.left = 0;
output->border.right = 0;
- output->mm_width = width;
- output->mm_height = height;
+ output->mm_width = mm_width;
+ output->mm_height = mm_height;
output->dirty = 1;
- weston_output_transform_init(output, transform);
- weston_output_scale_init(output, scale);
+ weston_output_transform_scale_init(output, transform, scale);
weston_output_init_zoom(output);
weston_output_move(output, x, y);
int32_t width, height;
pixman_region32_t buffer_damage, total_damage;
- width = output->current->width * output->scale +
+ width = output->current->width +
output->border.left + output->border.right;
- height = output->current->height * output->scale +
+ height = output->current->height +
output->border.top + output->border.bottom;
glViewport(0, 0, width, height);
return -1;
/* set shadow image transformation */
- w = output->current->width * output->scale;
- h = output->current->height * output->scale;
+ w = output->current->width;
+ h = output->current->height;
po->shadow_buffer = malloc(w * h * 4);