mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philippe CORNU <philippe.cornu@st.com>
To: Vincent ABRIOU <vincent.abriou@st.com>,
	Yannick FERTRE <yannick.fertre@st.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	David Airlie <airlied@linux.ie>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Fabien DESSENNE <fabien.dessenne@st.com>,
	Mickael REULIER <mickael.reulier@st.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>
Subject: Re: [PATCH] drm/stm: ltdc: add user update info in plane print state
Date: Thu, 19 Apr 2018 10:38:06 +0000	[thread overview]
Message-ID: <5d6c7997-190a-2015-59f6-156e156cbbb7@st.com> (raw)
In-Reply-To: <8843fede-9859-7332-1e34-515efe58024c@st.com>

Applied on drm-misc-next.
Many thanks,
Philippe :-)

On 04/16/2018 11:14 AM, Vincent ABRIOU wrote:
> Hi Philippe,
> 
> Reviewed-by: Vincent Abriou <vincent.abriou@st.com>
> 
> On 04/07/2018 11:35 PM, Philippe Cornu wrote:
>> This patch adds the user update information in
>> frames-per-second into the drm debugfs plane state.
>>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> ---
>>    drivers/gpu/drm/stm/ltdc.c | 22 ++++++++++++++++++++++
>>    drivers/gpu/drm/stm/ltdc.h |  8 ++++++++
>>    2 files changed, 30 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
>> index 2b745cfc9000..061d2b6e5157 100644
>> --- a/drivers/gpu/drm/stm/ltdc.c
>> +++ b/drivers/gpu/drm/stm/ltdc.c
>> @@ -729,6 +729,8 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
>>    	reg_update_bits(ldev->regs, LTDC_L1CR + lofs,
>>    			LXCR_LEN | LXCR_CLUTEN, val);
>>    
>> +	ldev->plane_fpsi[plane->index].counter++;
>> +
>>    	mutex_lock(&ldev->err_lock);
>>    	if (ldev->error_status & ISR_FUIF) {
>>    		DRM_DEBUG_DRIVER("Fifo underrun\n");
>> @@ -754,6 +756,25 @@ static void ltdc_plane_atomic_disable(struct drm_plane *plane,
>>    			 oldstate->crtc->base.id, plane->base.id);
>>    }
>>    
>> +static void ltdc_plane_atomic_print_state(struct drm_printer *p,
>> +					  const struct drm_plane_state *state)
>> +{
>> +	struct drm_plane *plane = state->plane;
>> +	struct ltdc_device *ldev = plane_to_ltdc(plane);
>> +	struct fps_info *fpsi = &ldev->plane_fpsi[plane->index];
>> +	int ms_since_last;
>> +	ktime_t now;
>> +
>> +	now = ktime_get();
>> +	ms_since_last = ktime_to_ms(ktime_sub(now, fpsi->last_timestamp));
>> +
>> +	drm_printf(p, "\tuser_updates=%dfps\n",
>> +		   DIV_ROUND_CLOSEST(fpsi->counter * 1000, ms_since_last));
>> +
>> +	fpsi->last_timestamp = now;
>> +	fpsi->counter = 0;
>> +}
>> +
>>    static const struct drm_plane_funcs ltdc_plane_funcs = {
>>    	.update_plane = drm_atomic_helper_update_plane,
>>    	.disable_plane = drm_atomic_helper_disable_plane,
>> @@ -761,6 +782,7 @@ static const struct drm_plane_funcs ltdc_plane_funcs = {
>>    	.reset = drm_atomic_helper_plane_reset,
>>    	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
>>    	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
>> +	.atomic_print_state = ltdc_plane_atomic_print_state,
>>    };
>>    
>>    static const struct drm_plane_helper_funcs ltdc_plane_helper_funcs = {
>> diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h
>> index 61a80d00bc3b..1e16d6afb0d2 100644
>> --- a/drivers/gpu/drm/stm/ltdc.h
>> +++ b/drivers/gpu/drm/stm/ltdc.h
>> @@ -20,6 +20,13 @@ struct ltdc_caps {
>>    	bool non_alpha_only_l1; /* non-native no-alpha formats on layer 1 */
>>    };
>>    
>> +#define LTDC_MAX_LAYER	4
>> +
>> +struct fps_info {
>> +	unsigned int counter;
>> +	ktime_t last_timestamp;
>> +};
>> +
>>    struct ltdc_device {
>>    	void __iomem *regs;
>>    	struct clk *pixel_clk;	/* lcd pixel clock */
>> @@ -27,6 +34,7 @@ struct ltdc_device {
>>    	struct ltdc_caps caps;
>>    	u32 error_status;
>>    	u32 irq_status;
>> +	struct fps_info plane_fpsi[LTDC_MAX_LAYER];
>>    };
>>    
>>    int ltdc_load(struct drm_device *ddev);

      reply	other threads:[~2018-04-19 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 21:35 Philippe Cornu
2018-04-16  9:14 ` Vincent ABRIOU
2018-04-19 10:38   ` Philippe CORNU [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d6c7997-190a-2015-59f6-156e156cbbb7@st.com \
    --to=philippe.cornu@st.com \
    --cc=airlied@linux.ie \
    --cc=alexandre.torgue@st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabien.dessenne@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mickael.reulier@st.com \
    --cc=vincent.abriou@st.com \
    --cc=yannick.fertre@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®