Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3638af76 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: sde: log pp-line count in event logs"

parents 118d196a 1e3d105d
Loading
Loading
Loading
Loading
+26 −2
Original line number Original line Diff line number Diff line
@@ -66,8 +66,6 @@
#define MAX_PHYS_ENCODERS_PER_VIRTUAL \
#define MAX_PHYS_ENCODERS_PER_VIRTUAL \
	(MAX_H_TILES_PER_DISPLAY * NUM_PHYS_ENCODER_TYPES)
	(MAX_H_TILES_PER_DISPLAY * NUM_PHYS_ENCODER_TYPES)


#define MAX_CHANNELS_PER_ENC 2

#define MISR_BUFF_SIZE			256
#define MISR_BUFF_SIZE			256


#define IDLE_SHORT_TIMEOUT	1
#define IDLE_SHORT_TIMEOUT	1
@@ -4785,6 +4783,32 @@ void sde_encoder_kickoff(struct drm_encoder *drm_enc, bool is_error)
	SDE_ATRACE_END("encoder_kickoff");
	SDE_ATRACE_END("encoder_kickoff");
}
}


void sde_encoder_helper_get_pp_line_count(struct drm_encoder *drm_enc,
			struct sde_hw_pp_vsync_info *info)
{
	struct sde_encoder_virt *sde_enc;
	struct sde_encoder_phys *phys;
	int i, ret;

	if (!drm_enc || !info)
		return;

	sde_enc = to_sde_encoder_virt(drm_enc);

	for (i = 0; i < sde_enc->num_phys_encs; i++) {
		phys = sde_enc->phys_encs[i];
		if (phys && phys->hw_intf && phys->hw_pp
				&& phys->hw_intf->ops.get_vsync_info) {
			ret = phys->hw_intf->ops.get_vsync_info(
						phys->hw_intf, &info[i]);
			if (!ret) {
				info[i].pp_idx = phys->hw_pp->idx - PINGPONG_0;
				info[i].intf_idx = phys->hw_intf->idx - INTF_0;
			}
		}
	}
}

int sde_encoder_helper_reset_mixers(struct sde_encoder_phys *phys_enc,
int sde_encoder_helper_reset_mixers(struct sde_encoder_phys *phys_enc,
		struct drm_framebuffer *fb)
		struct drm_framebuffer *fb)
{
{
+2 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,8 @@
#include "sde_hw_mdss.h"
#include "sde_hw_mdss.h"
#include "sde_kms.h"
#include "sde_kms.h"


#define MAX_CHANNELS_PER_ENC 2

#define SDE_ENCODER_FRAME_EVENT_DONE			BIT(0)
#define SDE_ENCODER_FRAME_EVENT_DONE			BIT(0)
#define SDE_ENCODER_FRAME_EVENT_ERROR			BIT(1)
#define SDE_ENCODER_FRAME_EVENT_ERROR			BIT(1)
#define SDE_ENCODER_FRAME_EVENT_PANEL_DEAD		BIT(2)
#define SDE_ENCODER_FRAME_EVENT_PANEL_DEAD		BIT(2)
+8 −0
Original line number Original line Diff line number Diff line
@@ -508,6 +508,14 @@ void sde_encoder_phys_setup_cdm(struct sde_encoder_phys *phys_enc,
		struct drm_framebuffer *fb, const struct sde_format *format,
		struct drm_framebuffer *fb, const struct sde_format *format,
		struct sde_rect *wb_roi);
		struct sde_rect *wb_roi);


/**
 * sde_encoder_helper_get_pp_line_count - pingpong linecount helper function
 * @drm_enc:    Pointer to drm encoder structure
 * @info:       structure used to populate the pp line count information
 */
void sde_encoder_helper_get_pp_line_count(struct drm_encoder *drm_enc,
		struct sde_hw_pp_vsync_info *info);

/**
/**
 * sde_encoder_helper_trigger_flush - control flush helper function
 * sde_encoder_helper_trigger_flush - control flush helper function
 *	This helper function may be optionally specified by physical
 *	This helper function may be optionally specified by physical
+11 −5
Original line number Original line Diff line number Diff line
@@ -256,6 +256,7 @@ static void sde_encoder_phys_cmd_te_rd_ptr_irq(void *arg, int irq_idx)
	struct sde_encoder_phys_cmd *cmd_enc;
	struct sde_encoder_phys_cmd *cmd_enc;
	u32 event = 0, scheduler_status = INVALID_CTL_STATUS;
	u32 event = 0, scheduler_status = INVALID_CTL_STATUS;
	struct sde_hw_ctl *ctl;
	struct sde_hw_ctl *ctl;
	struct sde_hw_pp_vsync_info info[MAX_CHANNELS_PER_ENC] = {{0}};


	if (!phys_enc || !phys_enc->hw_pp || !phys_enc->hw_intf)
	if (!phys_enc || !phys_enc->hw_pp || !phys_enc->hw_intf)
		return;
		return;
@@ -282,10 +283,11 @@ static void sde_encoder_phys_cmd_te_rd_ptr_irq(void *arg, int irq_idx)
	if (ctl && ctl->ops.get_scheduler_status)
	if (ctl && ctl->ops.get_scheduler_status)
		scheduler_status = ctl->ops.get_scheduler_status(ctl);
		scheduler_status = ctl->ops.get_scheduler_status(ctl);


	sde_encoder_helper_get_pp_line_count(phys_enc->parent, info);
	SDE_EVT32_IRQ(DRMID(phys_enc->parent),
	SDE_EVT32_IRQ(DRMID(phys_enc->parent),
			phys_enc->hw_pp->idx - PINGPONG_0,
		info[0].pp_idx, info[0].intf_idx, info[0].wr_ptr_line_count,
			phys_enc->hw_intf->idx - INTF_0,
		event, scheduler_status,
			event, scheduler_status, 0xfff);
		info[1].pp_idx, info[1].intf_idx, info[1].wr_ptr_line_count);


	if (phys_enc->parent_ops.handle_vblank_virt)
	if (phys_enc->parent_ops.handle_vblank_virt)
		phys_enc->parent_ops.handle_vblank_virt(phys_enc->parent,
		phys_enc->parent_ops.handle_vblank_virt(phys_enc->parent,
@@ -305,6 +307,7 @@ static void sde_encoder_phys_cmd_ctl_start_irq(void *arg, int irq_idx)
	struct sde_hw_ctl *ctl;
	struct sde_hw_ctl *ctl;
	u32 event = 0;
	u32 event = 0;
	s64 time_diff_us;
	s64 time_diff_us;
	struct sde_hw_pp_vsync_info info[MAX_CHANNELS_PER_ENC] = {{0}};


	if (!phys_enc || !phys_enc->hw_ctl)
	if (!phys_enc || !phys_enc->hw_ctl)
		return;
		return;
@@ -348,8 +351,11 @@ static void sde_encoder_phys_cmd_ctl_start_irq(void *arg, int irq_idx)
		}
		}
	}
	}


	SDE_EVT32_IRQ(DRMID(phys_enc->parent), ctl->idx - CTL_0,
	sde_encoder_helper_get_pp_line_count(phys_enc->parent, info);
				time_diff_us, event, 0xfff);
	SDE_EVT32_IRQ(DRMID(phys_enc->parent),
		ctl->idx - CTL_0, time_diff_us, event,
		info[0].pp_idx, info[0].intf_idx, info[0].wr_ptr_line_count,
		info[1].pp_idx, info[1].intf_idx, info[1].wr_ptr_line_count);


	/* Signal any waiting ctl start interrupt */
	/* Signal any waiting ctl start interrupt */
	wake_up_all(&phys_enc->pending_kickoff_wq);
	wake_up_all(&phys_enc->pending_kickoff_wq);
+4 −0
Original line number Original line Diff line number Diff line
@@ -667,12 +667,16 @@ struct sde_hw_autorefresh {
/**
/**
 * struct sde_hw_pp_vsync_info - Struct contains parameters to configure
 * struct sde_hw_pp_vsync_info - Struct contains parameters to configure
 *        read and write pointers for command mode panels
 *        read and write pointers for command mode panels
 * @pp_idx:		Ping-pong block index
 * @intf_idx:		Interface block index
 * @rd_ptr_init_val:	Value of rd pointer at vsync edge
 * @rd_ptr_init_val:	Value of rd pointer at vsync edge
 * @rd_ptr_frame_count:	num frames sent since enabling interface
 * @rd_ptr_frame_count:	num frames sent since enabling interface
 * @rd_ptr_line_count:	current line on panel (rd ptr)
 * @rd_ptr_line_count:	current line on panel (rd ptr)
 * @wr_ptr_line_count:	current line within pp fifo (wr ptr)
 * @wr_ptr_line_count:	current line within pp fifo (wr ptr)
 */
 */
struct sde_hw_pp_vsync_info {
struct sde_hw_pp_vsync_info {
	u32 pp_idx;
	u32 intf_idx;
	u32 rd_ptr_init_val;
	u32 rd_ptr_init_val;
	u32 rd_ptr_frame_count;
	u32 rd_ptr_frame_count;
	u32 rd_ptr_line_count;
	u32 rd_ptr_line_count;