提交 c70f577a 编写于 作者: V Ville Syrjälä 提交者: Daniel Vetter

drm: Add "prefix" parameter to drm_rect_debug_print()

Allow the caller to specify a "prefix" string to drm_rect_debug_print()
to make it easier to see which drm_rect is being printed.
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 02e6f379
...@@ -275,22 +275,23 @@ EXPORT_SYMBOL(drm_rect_calc_vscale_relaxed); ...@@ -275,22 +275,23 @@ EXPORT_SYMBOL(drm_rect_calc_vscale_relaxed);
/** /**
* drm_rect_debug_print - print the rectangle information * drm_rect_debug_print - print the rectangle information
* @prefix: prefix string
* @r: rectangle to print * @r: rectangle to print
* @fixed_point: rectangle is in 16.16 fixed point format * @fixed_point: rectangle is in 16.16 fixed point format
*/ */
void drm_rect_debug_print(const struct drm_rect *r, bool fixed_point) void drm_rect_debug_print(const char *prefix, const struct drm_rect *r, bool fixed_point)
{ {
int w = drm_rect_width(r); int w = drm_rect_width(r);
int h = drm_rect_height(r); int h = drm_rect_height(r);
if (fixed_point) if (fixed_point)
DRM_DEBUG_KMS("%d.%06ux%d.%06u%+d.%06u%+d.%06u\n", DRM_DEBUG_KMS("%s%d.%06ux%d.%06u%+d.%06u%+d.%06u\n", prefix,
w >> 16, ((w & 0xffff) * 15625) >> 10, w >> 16, ((w & 0xffff) * 15625) >> 10,
h >> 16, ((h & 0xffff) * 15625) >> 10, h >> 16, ((h & 0xffff) * 15625) >> 10,
r->x1 >> 16, ((r->x1 & 0xffff) * 15625) >> 10, r->x1 >> 16, ((r->x1 & 0xffff) * 15625) >> 10,
r->y1 >> 16, ((r->y1 & 0xffff) * 15625) >> 10); r->y1 >> 16, ((r->y1 & 0xffff) * 15625) >> 10);
else else
DRM_DEBUG_KMS("%dx%d%+d%+d\n", w, h, r->x1, r->y1); DRM_DEBUG_KMS("%s%dx%d%+d%+d\n", prefix, w, h, r->x1, r->y1);
} }
EXPORT_SYMBOL(drm_rect_debug_print); EXPORT_SYMBOL(drm_rect_debug_print);
......
...@@ -832,8 +832,8 @@ intel_check_sprite_plane(struct drm_plane *plane, ...@@ -832,8 +832,8 @@ intel_check_sprite_plane(struct drm_plane *plane,
hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
if (hscale < 0) { if (hscale < 0) {
DRM_DEBUG_KMS("Horizontal scaling factor out of limits\n"); DRM_DEBUG_KMS("Horizontal scaling factor out of limits\n");
drm_rect_debug_print(src, true); drm_rect_debug_print("src: ", src, true);
drm_rect_debug_print(dst, false); drm_rect_debug_print("dst: ", dst, false);
return hscale; return hscale;
} }
...@@ -841,8 +841,8 @@ intel_check_sprite_plane(struct drm_plane *plane, ...@@ -841,8 +841,8 @@ intel_check_sprite_plane(struct drm_plane *plane,
vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
if (vscale < 0) { if (vscale < 0) {
DRM_DEBUG_KMS("Vertical scaling factor out of limits\n"); DRM_DEBUG_KMS("Vertical scaling factor out of limits\n");
drm_rect_debug_print(src, true); drm_rect_debug_print("src: ", src, true);
drm_rect_debug_print(dst, false); drm_rect_debug_print("dst: ", dst, false);
return vscale; return vscale;
} }
......
...@@ -162,7 +162,8 @@ int drm_rect_calc_hscale_relaxed(struct drm_rect *src, ...@@ -162,7 +162,8 @@ int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
int drm_rect_calc_vscale_relaxed(struct drm_rect *src, int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
struct drm_rect *dst, struct drm_rect *dst,
int min_vscale, int max_vscale); int min_vscale, int max_vscale);
void drm_rect_debug_print(const struct drm_rect *r, bool fixed_point); void drm_rect_debug_print(const char *prefix,
const struct drm_rect *r, bool fixed_point);
void drm_rect_rotate(struct drm_rect *r, void drm_rect_rotate(struct drm_rect *r,
int width, int height, int width, int height,
unsigned int rotation); unsigned int rotation);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册