diff mbox series

[v2,1/4] drm: Add kernel-doc for drm_framebuffer_check_src_coords()

Message ID 20230718181726.3799-2-gcarlos@disroot.org (mailing list archive)
State New, archived
Headers show
Series Add documentation and KUnit tests for functions on drm_framebuffer.c | expand

Commit Message

Carlos Eduardo Gallo Filho July 18, 2023, 6:17 p.m. UTC
Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
---
 drivers/gpu/drm/drm_framebuffer.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Comments

Maxime Ripard July 19, 2023, 7:24 a.m. UTC | #1
On Tue, Jul 18, 2023 at 03:17:23PM -0300, Carlos Eduardo Gallo Filho wrote:
> Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>

As a general rule of thumb, a commit log is always needed :)

Looks good otherwise, once fixed
Acked-by: Maxime Ripard <mripard@kernel.org>

Maxime
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index aff3746dedfb..49df3ca3b3ee 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -73,6 +73,21 @@ 
  * drm_framebuffer.
  */
 
+/**
+ * drm_framebuffer_check_src_coords - check if the source with given
+ * coordinates and sizes is inside the framebuffer
+ * @src_x: source x coordinate
+ * @src_y: source y coordinate
+ * @src_w: source width
+ * @src_h: source height
+ * @fb: pointer to the framebuffer to check
+ *
+ * This function checks if an object with the given set of coordinates and
+ * sizes fits inside the framebuffer by looking at its size.
+ *
+ * Returns:
+ * Zero on success, negative errno on failure.
+ */
 int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
 				     uint32_t src_w, uint32_t src_h,
 				     const struct drm_framebuffer *fb)
@@ -82,7 +97,6 @@  int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
 	fb_width = fb->width << 16;
 	fb_height = fb->height << 16;
 
-	/* Make sure source coordinates are inside the fb. */
 	if (src_w > fb_width ||
 	    src_x > fb_width - src_w ||
 	    src_h > fb_height ||