Pārlūkot izejas kodu

drm/sti: update fps debugfs entries

This update allows to have a clearer fps log trace by adding information
about plane size and plane pixel format.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Vincent Abriou 8 gadi atpakaļ
vecāks
revīzija
a69e466b06
2 mainītis faili ar 14 papildinājumiem un 5 dzēšanām
  1. 13 4
      drivers/gpu/drm/sti/sti_plane.c
  2. 1 1
      drivers/gpu/drm/sti/sti_plane.h

+ 13 - 4
drivers/gpu/drm/sti/sti_plane.c

@@ -65,9 +65,18 @@ void sti_plane_update_fps(struct sti_plane *plane,
 
 
 	fps->last_timestamp = now;
 	fps->last_timestamp = now;
 	fps->last_frame_counter = fps->curr_frame_counter;
 	fps->last_frame_counter = fps->curr_frame_counter;
-	fpks = (num_frames * 1000000) / ms_since_last;
-	snprintf(plane->fps_info.fps_str, FPS_LENGTH, "%-6s @ %d.%.3d fps",
-		 sti_plane_to_str(plane), fpks / 1000, fpks % 1000);
+
+	if (plane->drm_plane.fb) {
+		fpks = (num_frames * 1000000) / ms_since_last;
+		snprintf(plane->fps_info.fps_str, FPS_LENGTH,
+			 "%-8s %4dx%-4d %.4s @ %3d.%-3.3d fps (%s)",
+			 plane->drm_plane.name,
+			 plane->drm_plane.fb->width,
+			 plane->drm_plane.fb->height,
+			 (char *)&plane->drm_plane.fb->pixel_format,
+			 fpks / 1000, fpks % 1000,
+			 sti_plane_to_str(plane));
+	}
 
 
 	if (fps->curr_field_counter) {
 	if (fps->curr_field_counter) {
 		/* Compute number of field updates */
 		/* Compute number of field updates */
@@ -75,7 +84,7 @@ void sti_plane_update_fps(struct sti_plane *plane,
 		fps->last_field_counter = fps->curr_field_counter;
 		fps->last_field_counter = fps->curr_field_counter;
 		fipks = (num_fields * 1000000) / ms_since_last;
 		fipks = (num_fields * 1000000) / ms_since_last;
 		snprintf(plane->fps_info.fips_str,
 		snprintf(plane->fps_info.fips_str,
-			 FPS_LENGTH, " - %d.%.3d field/sec",
+			 FPS_LENGTH, " - %3d.%-3.3d field/sec",
 			 fipks / 1000, fipks % 1000);
 			 fipks / 1000, fipks % 1000);
 	} else {
 	} else {
 		plane->fps_info.fips_str[0] = '\0';
 		plane->fps_info.fips_str[0] = '\0';

+ 1 - 1
drivers/gpu/drm/sti/sti_plane.h

@@ -48,7 +48,7 @@ enum sti_plane_status {
 	STI_PLANE_DISABLED,
 	STI_PLANE_DISABLED,
 };
 };
 
 
-#define FPS_LENGTH 64
+#define FPS_LENGTH 128
 struct sti_fps_info {
 struct sti_fps_info {
 	bool output;
 	bool output;
 	unsigned int curr_frame_counter;
 	unsigned int curr_frame_counter;