drm/vmwgfx: Add debug message for layout change ioctl
authorDeepak Rawat <drawat@vmware.com>
Thu, 9 May 2019 18:47:40 +0000 (11:47 -0700)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 14 Aug 2019 06:27:27 +0000 (08:27 +0200)
Add debug code to check user-space layout change request.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index dbb04dbcf4789718392b45ec3c6e2b896b41dc87..7402e445884a8945c6ed16ec2447a1c14b53a938 100644 (file)
@@ -1333,6 +1333,14 @@ int vmw_host_log(const char *log);
 #define VMW_DEBUG_USER(fmt, ...)                                              \
        DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
 
+/**
+ * VMW_DEBUG_KMS - Debug output for kernel mode-setting
+ *
+ * This macro is for debugging vmwgfx mode-setting code.
+ */
+#define VMW_DEBUG_KMS(fmt, ...)                                               \
+       DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
+
 /**
  * Inline helper functions
  */
index 34284f0f508410804a53a0e04f6086ca31b2952b..59d06f9808216b983a918b027f92a046f2d77952 100644 (file)
@@ -2339,6 +2339,9 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
 
        if (!arg->num_outputs) {
                struct drm_rect def_rect = {0, 0, 800, 600};
+               VMW_DEBUG_KMS("Default layout x1 = %d y1 = %d x2 = %d y2 = %d\n",
+                             def_rect.x1, def_rect.y1,
+                             def_rect.x2, def_rect.y2);
                vmw_du_update_layout(dev_priv, 1, &def_rect);
                return 0;
        }
@@ -2359,6 +2362,7 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
 
        drm_rects = (struct drm_rect *)rects;
 
+       VMW_DEBUG_KMS("Layout count = %u\n", arg->num_outputs);
        for (i = 0; i < arg->num_outputs; i++) {
                struct drm_vmw_rect curr_rect;
 
@@ -2375,6 +2379,10 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
                drm_rects[i].x2 = curr_rect.x + curr_rect.w;
                drm_rects[i].y2 = curr_rect.y + curr_rect.h;
 
+               VMW_DEBUG_KMS("  x1 = %d y1 = %d x2 = %d y2 = %d\n",
+                             drm_rects[i].x1, drm_rects[i].y1,
+                             drm_rects[i].x2, drm_rects[i].y2);
+
                /*
                 * Currently this check is limiting the topology within
                 * mode_config->max (which actually is max texture size