Re: [PATCH weston 04/68] compositor-drm: Delete drm_backend_set_modes

2016-12-09 Thread Armin Krezović
On 09.12.2016 20:57, Daniel Stone wrote:
> Even if we do have a framebuffer matching the mode, we immediately
> schedule a repaint, meaning we either do work for no reason, or show
> stale content before we bring up the new content.
> 
> Delete this and just let repaint deal with it.
> 
> Differential Revision: https://phabricator.freedesktop.org/D1481
> 
> Signed-off-by: Daniel Stone 

Since drm_output_repaint() calls drmModeSetCrtc() when needed and
weston_compositor_damage_all() will schedule a repaint, this makes
sense.

Reviewed-by: Armin Krezović 

> ---
>  libweston/compositor-drm.c | 33 -
>  1 file changed, 33 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 268117d..7d1c01b 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -2824,38 +2824,6 @@ drm_destroy(struct weston_compositor *ec)
>  }
>  
>  static void
> -drm_backend_set_modes(struct drm_backend *backend)
> -{
> - struct drm_output *output;
> - struct drm_mode *drm_mode;
> - int ret;
> -
> - wl_list_for_each(output, >compositor->output_list, base.link) {
> - if (!output->current) {
> - /* If something that would cause the output to
> -  * switch mode happened while in another vt, we
> -  * might not have a current drm_fb. In that case,
> -  * schedule a repaint and let drm_output_repaint
> -  * handle setting the mode. */
> - weston_output_schedule_repaint(>base);
> - continue;
> - }
> -
> - drm_mode = (struct drm_mode *) output->base.current_mode;
> - ret = drmModeSetCrtc(backend->drm.fd, output->crtc_id,
> -  output->current->fb_id, 0, 0,
> -  >connector_id, 1,
> -  _mode->mode_info);
> - if (ret < 0) {
> - weston_log(
> - "failed to set mode %dx%d for output at %d,%d: 
> %m\n",
> - drm_mode->base.width, drm_mode->base.height,
> - output->base.x, output->base.y);
> - }
> - }
> -}
> -
> -static void
>  session_notify(struct wl_listener *listener, void *data)
>  {
>   struct weston_compositor *compositor = data;
> @@ -2866,7 +2834,6 @@ session_notify(struct wl_listener *listener, void *data)
>   if (compositor->session_active) {
>   weston_log("activating session\n");
>   compositor->state = b->prev_state;
> - drm_backend_set_modes(b);
>   weston_compositor_damage_all(compositor);
>   udev_input_enable(>input);
>   } else {
> 




signature.asc
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 04/68] compositor-drm: Delete drm_backend_set_modes

2016-12-09 Thread Daniel Stone
Even if we do have a framebuffer matching the mode, we immediately
schedule a repaint, meaning we either do work for no reason, or show
stale content before we bring up the new content.

Delete this and just let repaint deal with it.

Differential Revision: https://phabricator.freedesktop.org/D1481

Signed-off-by: Daniel Stone 
---
 libweston/compositor-drm.c | 33 -
 1 file changed, 33 deletions(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 268117d..7d1c01b 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2824,38 +2824,6 @@ drm_destroy(struct weston_compositor *ec)
 }
 
 static void
-drm_backend_set_modes(struct drm_backend *backend)
-{
-   struct drm_output *output;
-   struct drm_mode *drm_mode;
-   int ret;
-
-   wl_list_for_each(output, >compositor->output_list, base.link) {
-   if (!output->current) {
-   /* If something that would cause the output to
-* switch mode happened while in another vt, we
-* might not have a current drm_fb. In that case,
-* schedule a repaint and let drm_output_repaint
-* handle setting the mode. */
-   weston_output_schedule_repaint(>base);
-   continue;
-   }
-
-   drm_mode = (struct drm_mode *) output->base.current_mode;
-   ret = drmModeSetCrtc(backend->drm.fd, output->crtc_id,
-output->current->fb_id, 0, 0,
->connector_id, 1,
-_mode->mode_info);
-   if (ret < 0) {
-   weston_log(
-   "failed to set mode %dx%d for output at %d,%d: 
%m\n",
-   drm_mode->base.width, drm_mode->base.height,
-   output->base.x, output->base.y);
-   }
-   }
-}
-
-static void
 session_notify(struct wl_listener *listener, void *data)
 {
struct weston_compositor *compositor = data;
@@ -2866,7 +2834,6 @@ session_notify(struct wl_listener *listener, void *data)
if (compositor->session_active) {
weston_log("activating session\n");
compositor->state = b->prev_state;
-   drm_backend_set_modes(b);
weston_compositor_damage_all(compositor);
udev_input_enable(>input);
} else {
-- 
2.9.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel