public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 08/11] drm/msm/dpu: Remove dpu_irq and unused functions
Date: Tue, 6 Nov 2018 09:46:11 -0500	[thread overview]
Message-ID: <20181106144611.GR154160@art_vandelay> (raw)
In-Reply-To: <20181105233103.7657-9-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Mon, Nov 05, 2018 at 04:31:00PM -0700, Jordan Crouse wrote:
> dpu_irq.c does some unneeded checks and passes control
> to dpu_core_irq.c  The simple functions can be defined
> in the same file where we use them and the files and
> their associated hangers on can be deleted.
> 
> Additionally the postinstall hook isn't used even
> in dpu_core_irq.c so zap that entire path.
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Nice!

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/Makefile                 |  1 -
>  drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c | 15 +----
>  drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h |  7 ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_irq.c      | 66 --------------------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_irq.h      | 59 -----------------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c      | 22 ++++++-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h      |  1 -
>  drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c     |  5 ++
>  8 files changed, 28 insertions(+), 148 deletions(-)
>  delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_irq.c
>  delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_irq.h
> 
> diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
> index e067dd1341b1..4b181c2a88d6 100644
> --- a/drivers/gpu/drm/msm/Makefile
> +++ b/drivers/gpu/drm/msm/Makefile
> @@ -68,7 +68,6 @@ msm-y := \
>  	disp/dpu1/dpu_hw_util.o \
>  	disp/dpu1/dpu_hw_vbif.o \
>  	disp/dpu1/dpu_io_util.o \
> -	disp/dpu1/dpu_irq.o \
>  	disp/dpu1/dpu_kms.o \
>  	disp/dpu1/dpu_mdss.o \
>  	disp/dpu1/dpu_plane.o \
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c
> index 7607aac9449c..f66070cb2f42 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c
> @@ -364,10 +364,7 @@ void dpu_core_irq_preinstall(struct dpu_kms *dpu_kms)
>  	struct msm_drm_private *priv;
>  	int i;
>  
> -	if (!dpu_kms) {
> -		DPU_ERROR("invalid dpu_kms\n");
> -		return;
> -	} else if (!dpu_kms->dev) {
> +	if (!dpu_kms->dev) {
>  		DPU_ERROR("invalid drm device\n");
>  		return;
>  	} else if (!dpu_kms->dev->dev_private) {
> @@ -398,20 +395,12 @@ void dpu_core_irq_preinstall(struct dpu_kms *dpu_kms)
>  	}
>  }
>  
> -int dpu_core_irq_postinstall(struct dpu_kms *dpu_kms)
> -{
> -	return 0;
> -}
> -
>  void dpu_core_irq_uninstall(struct dpu_kms *dpu_kms)
>  {
>  	struct msm_drm_private *priv;
>  	int i;
>  
> -	if (!dpu_kms) {
> -		DPU_ERROR("invalid dpu_kms\n");
> -		return;
> -	} else if (!dpu_kms->dev) {
> +	if (!dpu_kms->dev) {
>  		DPU_ERROR("invalid drm device\n");
>  		return;
>  	} else if (!dpu_kms->dev->dev_private) {
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h
> index 5e98bba46af5..884f77fa3eb6 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h
> @@ -23,13 +23,6 @@
>   */
>  void dpu_core_irq_preinstall(struct dpu_kms *dpu_kms);
>  
> -/**
> - * dpu_core_irq_postinstall - perform post-installation of core IRQ handler
> - * @dpu_kms:		DPU handle
> - * @return:		0 if success; error code otherwise
> - */
> -int dpu_core_irq_postinstall(struct dpu_kms *dpu_kms);
> -
>  /**
>   * dpu_core_irq_uninstall - uninstall core IRQ handler
>   * @dpu_kms:		DPU handle
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_irq.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_irq.c
> deleted file mode 100644
> index d5e6ce0140cf..000000000000
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_irq.c
> +++ /dev/null
> @@ -1,66 +0,0 @@
> -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 and
> - * only version 2 as published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - */
> -
> -#define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
> -
> -#include <linux/irqdomain.h>
> -#include <linux/irq.h>
> -#include <linux/kthread.h>
> -
> -#include "dpu_irq.h"
> -#include "dpu_core_irq.h"
> -
> -irqreturn_t dpu_irq(struct msm_kms *kms)
> -{
> -	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> -
> -	return dpu_core_irq(dpu_kms);
> -}
> -
> -void dpu_irq_preinstall(struct msm_kms *kms)
> -{
> -	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> -
> -	if (!dpu_kms->dev || !dpu_kms->dev->dev) {
> -		pr_err("invalid device handles\n");
> -		return;
> -	}
> -
> -	dpu_core_irq_preinstall(dpu_kms);
> -}
> -
> -int dpu_irq_postinstall(struct msm_kms *kms)
> -{
> -	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> -	int rc;
> -
> -	if (!kms) {
> -		DPU_ERROR("invalid parameters\n");
> -		return -EINVAL;
> -	}
> -
> -	rc = dpu_core_irq_postinstall(dpu_kms);
> -
> -	return rc;
> -}
> -
> -void dpu_irq_uninstall(struct msm_kms *kms)
> -{
> -	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> -
> -	if (!kms) {
> -		DPU_ERROR("invalid parameters\n");
> -		return;
> -	}
> -
> -	dpu_core_irq_uninstall(dpu_kms);
> -}
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_irq.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_irq.h
> deleted file mode 100644
> index 3e147f7176e2..000000000000
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_irq.h
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 and
> - * only version 2 as published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - */
> -
> -#ifndef __DPU_IRQ_H__
> -#define __DPU_IRQ_H__
> -
> -#include <linux/kernel.h>
> -#include <linux/irqdomain.h>
> -
> -#include "msm_kms.h"
> -
> -/**
> - * dpu_irq_controller - define MDSS level interrupt controller context
> - * @enabled_mask:	enable status of MDSS level interrupt
> - * @domain:		interrupt domain of this controller
> - */
> -struct dpu_irq_controller {
> -	unsigned long enabled_mask;
> -	struct irq_domain *domain;
> -};
> -
> -/**
> - * dpu_irq_preinstall - perform pre-installation of MDSS IRQ handler
> - * @kms:		pointer to kms context
> - * @return:		none
> - */
> -void dpu_irq_preinstall(struct msm_kms *kms);
> -
> -/**
> - * dpu_irq_postinstall - perform post-installation of MDSS IRQ handler
> - * @kms:		pointer to kms context
> - * @return:		0 if success; error code otherwise
> - */
> -int dpu_irq_postinstall(struct msm_kms *kms);
> -
> -/**
> - * dpu_irq_uninstall - uninstall MDSS IRQ handler
> - * @drm_dev:		pointer to kms context
> - * @return:		none
> - */
> -void dpu_irq_uninstall(struct msm_kms *kms);
> -
> -/**
> - * dpu_irq - MDSS level IRQ handler
> - * @kms:		pointer to kms context
> - * @return:		interrupt handling status
> - */
> -irqreturn_t dpu_irq(struct msm_kms *kms);
> -
> -#endif /* __DPU_IRQ_H__ */
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 7e3ba128cbaf..2a91881048c8 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -706,10 +706,30 @@ static void _dpu_kms_set_encoder_mode(struct msm_kms *kms,
>  			encoder->base.id, rc);
>  }
>  
> +static irqreturn_t dpu_irq(struct msm_kms *kms)
> +{
> +	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> +
> +	return dpu_core_irq(dpu_kms);
> +}
> +
> +static void dpu_irq_preinstall(struct msm_kms *kms)
> +{
> +	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> +
> +	dpu_core_irq_preinstall(dpu_kms);
> +}
> +
> +static void dpu_irq_uninstall(struct msm_kms *kms)
> +{
> +	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
> +
> +	dpu_core_irq_uninstall(dpu_kms);
> +}
> +
>  static const struct msm_kms_funcs kms_funcs = {
>  	.hw_init         = dpu_kms_hw_init,
>  	.irq_preinstall  = dpu_irq_preinstall,
> -	.irq_postinstall = dpu_irq_postinstall,
>  	.irq_uninstall   = dpu_irq_uninstall,
>  	.irq             = dpu_irq,
>  	.prepare_commit  = dpu_kms_prepare_commit,
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> index 12a2eb90e6b5..e7539c9870e4 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> @@ -30,7 +30,6 @@
>  #include "dpu_hw_top.h"
>  #include "dpu_rm.h"
>  #include "dpu_power_handle.h"
> -#include "dpu_irq.h"
>  #include "dpu_core_perf.h"
>  
>  #define DRMID(x) ((x) ? (x)->base.id : -1)
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
> index 2235ef8129f4..19abf719811a 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
> @@ -9,6 +9,11 @@
>  
>  #define HW_INTR_STATUS			0x0010
>  
> +struct dpu_irq_controller {
> +	unsigned long enabled_mask;
> +	struct irq_domain *domain;
> +};
> +
>  struct dpu_mdss {
>  	struct msm_mdss base;
>  	void __iomem *mmio;
> -- 
> 2.18.0
> 
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-11-06 14:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 23:30 [PATCH v2 00/11] DPU cleanups Jordan Crouse
2018-11-05 23:30 ` [PATCH 01/11] drm/msm/dpu: Remove dpu_dbg Jordan Crouse
     [not found]   ` <20181105233103.7657-2-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 14:22     ` Sean Paul
2018-11-05 23:31 ` [PATCH 10/11] drm/msm/dpu: Further cleanups for static inline functions Jordan Crouse
2018-11-06 15:12   ` Sean Paul
     [not found] ` <20181105233103.7657-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-05 23:30   ` [PATCH 02/11] drm/msm/dpu: Use DEFINE_SHOW_ATTRIBUTE Jordan Crouse
2018-11-06 14:28     ` Sean Paul
2018-11-05 23:30   ` [PATCH 03/11] drm/msm/dpu: Remove dpu_crtc_get_mixer_height Jordan Crouse
     [not found]     ` <20181105233103.7657-4-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 14:30       ` Sean Paul
2018-11-05 23:30   ` [PATCH 04/11] drm/msm/dpu: Remove dpu_crtc_is_enabled() Jordan Crouse
2018-11-06 14:31     ` Sean Paul
2018-11-05 23:30   ` [PATCH 05/11] drm/msm/dpu: Remove unused functions Jordan Crouse
2018-11-06 14:31     ` Sean Paul
2018-11-05 23:30   ` [PATCH 06/11] drm/msm/dpu: Cleanup callers of dpu_hw_blk_init Jordan Crouse
     [not found]     ` <20181105233103.7657-7-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 14:45       ` Sean Paul
2018-11-05 23:30   ` [PATCH 07/11] drm/msm: Make irq_postinstall optional Jordan Crouse
     [not found]     ` <20181105233103.7657-8-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 14:46       ` Sean Paul
2018-11-05 23:31   ` [PATCH 08/11] drm/msm/dpu: Remove dpu_irq and unused functions Jordan Crouse
     [not found]     ` <20181105233103.7657-9-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 14:46       ` Sean Paul [this message]
2018-11-05 23:31   ` [PATCH 09/11] drm/msm/dpu: Cleanup the debugfs functions Jordan Crouse
     [not found]     ` <20181105233103.7657-10-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 15:05       ` Sean Paul
2018-11-05 23:31   ` [PATCH 11/11] drm/msm/dpu: Clean up dpu_media_info.h static inline functions Jordan Crouse
     [not found]     ` <20181105233103.7657-12-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-06 15:13       ` Sean Paul
2018-11-06 16:16       ` Sam Ravnborg
2018-11-07 19:55   ` [PATCH v3 1/2] drm/msm/dpu: Further cleanups for " Jordan Crouse
     [not found]     ` <20181107195503.12204-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-07 19:55       ` [PATCH v3 2/2] drm/msm/dpu: Clean up dpu_media_info.h " Jordan Crouse
  -- strict thread matches above, loose matches on Subject: below --
2018-10-18 19:58 [PATCH 00/11] DPU cleanups Jordan Crouse
     [not found] ` <20181018195836.15885-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-18 19:58   ` [PATCH 08/11] drm/msm/dpu: Remove dpu_irq and unused functions Jordan Crouse
     [not found]     ` <20181018195836.15885-9-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-19 14:56       ` Bruce Wang

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=20181106144611.GR154160@art_vandelay \
    --to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
    --cc=abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    /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