Re: [PATCH weston 13/68] compositor-drm: Use signed int for width/height

2016-12-09 Thread Armin Krezović
On 09.12.2016 20:57, Daniel Stone wrote:
> This makes it sign-compatible with weston_output->{width,height}.
> 
> Differential Revision: https://phabricator.freedesktop.org/D1486
> 
> Signed-off-by: Daniel Stone 
> Reviewed-by: Quentin Glidic 

Makes sense

Reviewed-by: Armin Krezović 

> ---
>  libweston/compositor-drm.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index a9bde0c..a5052b9 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -104,8 +104,8 @@ struct drm_backend {
>* due to out of bounds dimensions, and then mistakenly set
>* sprites_are_broken:
>*/
> - uint32_t min_width, max_width;
> - uint32_t min_height, max_height;
> + int min_width, max_width;
> + int min_height, max_height;
>   int no_addfb2;
>  
>   struct wl_list sprite_list;
> @@ -253,7 +253,7 @@ drm_fb_destroy_callback(struct gbm_bo *bo, void *data)
>  }
>  
>  static struct drm_fb *
> -drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height,
> +drm_fb_create_dumb(struct drm_backend *b, int width, int height,
>  uint32_t format)
>  {
>   struct drm_fb *fb;
> @@ -371,7 +371,7 @@ drm_fb_get_from_bo(struct gbm_bo *bo,
>  struct drm_backend *backend, uint32_t format)
>  {
>   struct drm_fb *fb = gbm_bo_get_user_data(bo);
> - uint32_t width, height;
> + int width, height;
>   uint32_t handles[4] = { 0 }, pitches[4] = { 0 }, offsets[4] = { 0 };
>   int ret;
>  
> @@ -391,7 +391,8 @@ drm_fb_get_from_bo(struct gbm_bo *bo,
>   fb->size = fb->stride * height;
>   fb->fd = backend->drm.fd;
>  
> - if (backend->min_width > width || width > backend->max_width ||
> + if (backend->min_width > width ||
> + width > backend->max_width ||
>   backend->min_height > height ||
>   height > backend->max_height) {
>   weston_log("bo geometry out of bounds\n");
> 

Ha, the patch description didn't mention coding style fix!

(Just kidding)



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 13/68] compositor-drm: Use signed int for width/height

2016-12-09 Thread Daniel Stone
This makes it sign-compatible with weston_output->{width,height}.

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

Signed-off-by: Daniel Stone 
Reviewed-by: Quentin Glidic 
---
 libweston/compositor-drm.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index a9bde0c..a5052b9 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -104,8 +104,8 @@ struct drm_backend {
 * due to out of bounds dimensions, and then mistakenly set
 * sprites_are_broken:
 */
-   uint32_t min_width, max_width;
-   uint32_t min_height, max_height;
+   int min_width, max_width;
+   int min_height, max_height;
int no_addfb2;
 
struct wl_list sprite_list;
@@ -253,7 +253,7 @@ drm_fb_destroy_callback(struct gbm_bo *bo, void *data)
 }
 
 static struct drm_fb *
-drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height,
+drm_fb_create_dumb(struct drm_backend *b, int width, int height,
   uint32_t format)
 {
struct drm_fb *fb;
@@ -371,7 +371,7 @@ drm_fb_get_from_bo(struct gbm_bo *bo,
   struct drm_backend *backend, uint32_t format)
 {
struct drm_fb *fb = gbm_bo_get_user_data(bo);
-   uint32_t width, height;
+   int width, height;
uint32_t handles[4] = { 0 }, pitches[4] = { 0 }, offsets[4] = { 0 };
int ret;
 
@@ -391,7 +391,8 @@ drm_fb_get_from_bo(struct gbm_bo *bo,
fb->size = fb->stride * height;
fb->fd = backend->drm.fd;
 
-   if (backend->min_width > width || width > backend->max_width ||
+   if (backend->min_width > width ||
+   width > backend->max_width ||
backend->min_height > height ||
height > backend->max_height) {
weston_log("bo geometry out of bounds\n");
-- 
2.9.3

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