[PATCH 2/3] compositor-drm: Add switch_mode support.

Juan Zhao juan.j.zhao at linux.intel.com
Tue Apr 17 18:01:53 PDT 2012


  On 04/17/2012 05:20 PM, zhiwen.wu at linux.intel.com wrote:
> +	if (!drm_mode) {
> +		printf("%s, invalid resolution:%dx%d\n", __func__, mode->width, mode->height);
> +		return -1;
> +	} else if (&drm_mode->base == output->base.current) {
> +		return 0;
> +	} else if (drm_mode->base.width == output->base.current->width&&
> +	           drm_mode->base.height == output->base.current->height) {
> +		/* only change refresh value */
> +		ret = drmModeSetCrtc(ec->drm.fd,
> +				     output->crtc_id,
> +				     output->current_fb_id, 0, 0,
> +				&output->connector_id, 1,&drm_mode->mode_info);
> +
> +		if (ret) {
> +			fprintf(stderr, "failed to set mode (%dx%d) %u Hz\n",
> +				drm_mode->base.width,
> +				drm_mode->base.height,
> +				drm_mode->base.refresh);
> +			ret = -1;
I would suggest align the error message by fprintf(stderr, "xxx"), or 
some general error message report method.
Because we don't have that general error message report method now, I 
suggest to use "fprintf(stderr, "xxxx")".


More information about the wayland-devel mailing list