[Freedreno] [PATCH] drm/msm/hdmi: redefinitions of macros not required

2017-03-13 Thread Vinay Simha BN
4 macros already defined in hdmi.h,
which is not required to redefine in hdmi_audio.c

Signed-off-by: Vinay Simha BN 
---
 drivers/gpu/drm/msm/hdmi/hdmi_audio.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_audio.c 
b/drivers/gpu/drm/msm/hdmi/hdmi_audio.c
index a54d3bb..8177e85 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_audio.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_audio.c
@@ -18,13 +18,6 @@
 #include 
 #include "hdmi.h"
 
-
-/* Supported HDMI Audio channels */
-#define MSM_HDMI_AUDIO_CHANNEL_2   0
-#define MSM_HDMI_AUDIO_CHANNEL_4   1
-#define MSM_HDMI_AUDIO_CHANNEL_6   2
-#define MSM_HDMI_AUDIO_CHANNEL_8   3
-
 /* maps MSM_HDMI_AUDIO_CHANNEL_n consts used by audio driver to # of channels: 
*/
 static int nchannels[] = { 2, 4, 6, 8 };
 
-- 
2.7.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


Re: [Freedreno] [RESEND PATCH] drm/msm: adreno: fix build error without debugfs

2017-03-13 Thread Sean Paul
On Mon, Mar 13, 2017 at 06:09:17PM +, Emil Velikov wrote:
> On 13 March 2017 at 17:00, Rob Clark  wrote:
> > On Mon, Mar 13, 2017 at 12:43 PM, Arnd Bergmann  wrote:
> >> The newly added a5xx support fails to build when debugfs is diabled:
> >>
> >> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:4: error: 'struct msm_gpu_funcs' 
> >> has no member named 'show'
> >> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:11: error: 'a5xx_show' 
> >> undeclared here (not in a function); did you mean 'a5xx_irq'?
> >>
> >> This adds a missing #ifdef.
> >>
> >> Fixes: b5f103ab98c7 ("drm/msm: gpu: Add A5XX target support")
> >> Cc: sta...@vger.kernel.org
> >> Signed-off-by: Arnd Bergmann 
> >
> > I thought I had picked this one up already, but I guess my brain was
> > playing tricks on me.. I've pushed this to msm-next for now and will
> > cherry-pick this over to a -fixes branch when I send fixes for 4.11..
> >
> Sean sent a similar patch last week. I think he picked it (alongside
> others) in drm-misc-fixes.
> Haven't checked though ;-)

Indeed [1]. I pushed it to drm-misc-fixes, but I don't see it there any longer.

At any rate, I'm glad we got the fix merged somewhere.

Sean

[1]- https://lists.freedesktop.org/archives/dri-devel/2017-March/134876.html

> 
> -Emil
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


Re: [Freedreno] [Intel-gfx] [PATCH 21/24] drm/msm: Simplify vblank event delivery

2017-03-13 Thread Sean Paul
On Wed, Mar 08, 2017 at 03:12:54PM +0100, Daniel Vetter wrote:
> The core takes care of handling the send_event vs. close() issues, we
> can remove that driver code.
> 
> Cc: Rob Clark 
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 12 +++-
>  drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 12 +++-
>  2 files changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c 
> b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> index 1c29618f4ddb..f29194a74a19 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> @@ -114,15 +114,9 @@ static void complete_flip(struct drm_crtc *crtc, struct 
> drm_file *file)

file unused now?

>   spin_lock_irqsave(&dev->event_lock, flags);
>   event = mdp4_crtc->event;
>   if (event) {
> - /* if regular vblank case (!file) or if cancel-flip from
> -  * preclose on file that requested flip, then send the
> -  * event:
> -  */
> - if (!file || (event->base.file_priv == file)) {
> - mdp4_crtc->event = NULL;
> - DBG("%s: send event: %p", mdp4_crtc->name, event);
> - drm_crtc_send_vblank_event(crtc, event);
> - }
> + mdp4_crtc->event = NULL;
> + DBG("%s: send event: %p", mdp4_crtc->name, event);
> + drm_crtc_send_vblank_event(crtc, event);
>   }
>   spin_unlock_irqrestore(&dev->event_lock, flags);
>  }
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c 
> b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> index d0c8b38b96ce..87a19e0c0e67 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> @@ -138,15 +138,9 @@ static void complete_flip(struct drm_crtc *crtc, struct 
> drm_file *file)
>   spin_lock_irqsave(&dev->event_lock, flags);
>   event = mdp5_crtc->event;
>   if (event) {
> - /* if regular vblank case (!file) or if cancel-flip from
> -  * preclose on file that requested flip, then send the
> -  * event:
> -  */
> - if (!file || (event->base.file_priv == file)) {
> - mdp5_crtc->event = NULL;
> - DBG("%s: send event: %p", crtc->name, event);
> - drm_crtc_send_vblank_event(crtc, event);
> - }
> + mdp5_crtc->event = NULL;
> + DBG("%s: send event: %p", crtc->name, event);
> + drm_crtc_send_vblank_event(crtc, event);
>   }
>   spin_unlock_irqrestore(&dev->event_lock, flags);
>  
> -- 
> 2.11.0
> 
> ___
> Intel-gfx mailing list
> intel-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


Re: [Freedreno] [Intel-gfx] [PATCH 13/24] drm/msm: switch to postclose

2017-03-13 Thread Sean Paul
On Wed, Mar 08, 2017 at 03:12:46PM +0100, Daniel Vetter wrote:
> I didn't spot anything that would require ordering here (well not
> anywhere else either), and I'm trying to unify at least modern drivers
> on one close hook.
> 
> Cc: Rob Clark 
> Cc: linux-arm-...@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> Signed-off-by: Daniel Vetter 

I think I've convinced myself that this is functionally equivalent (or at least
if Bad Things could happen with postclose, they would also be Bad Things with
preclose). So, fwiw:

Reviewed-by: Sean Paul 

> ---
>  drivers/gpu/drm/msm/msm_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 604331f3cf39..44774f02ef0e 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -540,7 +540,7 @@ static int msm_open(struct drm_device *dev, struct 
> drm_file *file)
>   return 0;
>  }
>  
> -static void msm_preclose(struct drm_device *dev, struct drm_file *file)
> +static void msm_postclose(struct drm_device *dev, struct drm_file *file)
>  {
>   struct msm_drm_private *priv = dev->dev_private;
>   struct msm_file_private *ctx = file->driver_priv;
> @@ -813,7 +813,7 @@ static struct drm_driver msm_driver = {
>   DRIVER_ATOMIC |
>   DRIVER_MODESET,
>   .open   = msm_open,
> - .preclose   = msm_preclose,
> + .postclose   = msm_postclose,
>   .lastclose  = msm_lastclose,
>   .irq_handler= msm_irq,
>   .irq_preinstall = msm_irq_preinstall,
> -- 
> 2.11.0
> 
> ___
> Intel-gfx mailing list
> intel-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


Re: [Freedreno] [RESEND PATCH] drm/msm: adreno: fix build error without debugfs

2017-03-13 Thread Emil Velikov
On 13 March 2017 at 17:00, Rob Clark  wrote:
> On Mon, Mar 13, 2017 at 12:43 PM, Arnd Bergmann  wrote:
>> The newly added a5xx support fails to build when debugfs is diabled:
>>
>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:4: error: 'struct msm_gpu_funcs' 
>> has no member named 'show'
>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:11: error: 'a5xx_show' undeclared 
>> here (not in a function); did you mean 'a5xx_irq'?
>>
>> This adds a missing #ifdef.
>>
>> Fixes: b5f103ab98c7 ("drm/msm: gpu: Add A5XX target support")
>> Cc: sta...@vger.kernel.org
>> Signed-off-by: Arnd Bergmann 
>
> I thought I had picked this one up already, but I guess my brain was
> playing tricks on me.. I've pushed this to msm-next for now and will
> cherry-pick this over to a -fixes branch when I send fixes for 4.11..
>
Sean sent a similar patch last week. I think he picked it (alongside
others) in drm-misc-fixes.
Haven't checked though ;-)

-Emil
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


Re: [Freedreno] [PATCH 5/6] drm/msm: gpu: Use OPP tables if we can

2017-03-13 Thread Rob Clark
On Tue, Mar 7, 2017 at 12:02 PM, Jordan Crouse  wrote:
> If a OPP table is defined for the GPU device in the device tree use
> that in lieu of the downstream style GPU frequency table. If we do
> use the downstream table convert it to a OPP table so that we can
> take advantage of the OPP lookup facilities later.

so this one should probably be accompanied by an update to
Documentation/devicetree/bindings/display/msm/gpu.txt (and cc'd to
devicetree list, although I think it should not be controversial to
use the proper bindings for this ;-))

otherwise, looks good.. 1/6 looks like fixes material so I'll pull
that one in immediately..

BR,
-R

> Signed-off-by: Jordan Crouse 
> ---
>  drivers/gpu/drm/msm/adreno/adreno_device.c | 85 
> +++---
>  1 file changed, 66 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
> b/drivers/gpu/drm/msm/adreno/adreno_device.c
> index 8374e9a..24da7f6 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
> @@ -17,6 +17,7 @@
>   * this program.  If not, see .
>   */
>
> +#include 
>  #include "adreno_gpu.h"
>
>  #define ANY_ID 0xff
> @@ -220,10 +221,71 @@ static int find_chipid(struct device *dev, u32 *chipid)
> return 0;
>  }
>
> +/* Get legacy powerlevels from qcom,gpu-pwrlevels and populate the opp table 
> */
> +static int adreno_get_legacy_pwrlevels(struct device *dev)
> +{
> +   struct device_node *child, *node;
> +   int ret;
> +
> +   node = of_find_compatible_node(dev->of_node, NULL,
> +   "qcom,gpu-pwrlevels");
> +   if (!node) {
> +   dev_err(dev, "Could not find the GPU powerlevels\n");
> +   return -ENXIO;
> +   }
> +
> +   for_each_child_of_node(node, child) {
> +   unsigned int val;
> +
> +   ret = of_property_read_u32(child, "qcom,gpu-freq", &val);
> +   if (ret)
> +   continue;
> +
> +   /*
> +* Skip the intentionally bogus clock value found at the 
> bottom
> +* of most legacy frequency tables
> +*/
> +   if (val != 2700)
> +   dev_pm_opp_add(dev, val, 0);
> +   }
> +
> +   return 0;
> +}
> +
> +static int adreno_get_pwrlevels(struct device *dev,
> +   struct adreno_platform_config *config)
> +{
> +   unsigned long freq = ULONG_MAX;
> +   struct dev_pm_opp *opp;
> +   int ret;
> +
> +   /* You down with OPP? */
> +   if (!of_find_property(dev->of_node, "operating-points-v2", NULL))
> +   ret = adreno_get_legacy_pwrlevels(dev);
> +   else
> +   ret = dev_pm_opp_of_add_table(dev);
> +
> +   if (ret)
> +   return ret;
> +
> +   /* Find the fastest defined rate */
> +   opp = dev_pm_opp_find_freq_floor(dev, &freq);
> +   if (!IS_ERR(opp))
> +   config->fast_rate = dev_pm_opp_get_freq(opp);
> +
> +   if (!config->fast_rate) {
> +   DRM_DEV_INFO(dev,
> +   "Could not find clock rate. Using default\n");
> +   /* Pick a suitably safe clock speed for any target */
> +   config->fast_rate = 2;
> +   }
> +
> +   return 0;
> +}
> +
>  static int adreno_bind(struct device *dev, struct device *master, void *data)
>  {
> static struct adreno_platform_config config = {};
> -   struct device_node *child, *node = dev->of_node;
> u32 val;
> int ret;
>
> @@ -238,25 +300,10 @@ static int adreno_bind(struct device *dev, struct 
> device *master, void *data)
>
> /* find clock rates: */
> config.fast_rate = 0;
> -   for_each_child_of_node(node, child) {
> -   if (of_device_is_compatible(child, "qcom,gpu-pwrlevels")) {
> -   struct device_node *pwrlvl;
> -   for_each_child_of_node(child, pwrlvl) {
> -   ret = of_property_read_u32(pwrlvl, 
> "qcom,gpu-freq", &val);
> -   if (ret) {
> -   dev_err(dev, "could not find 
> gpu-freq: %d\n", ret);
> -   return ret;
> -   }
> -   config.fast_rate = max(config.fast_rate, val);
> -   }
> -   }
> -   }
>
> -   if (!config.fast_rate) {
> -   dev_warn(dev, "could not find clk rates\n");
> -   /* This is a safe low speed for all devices: */
> -   config.fast_rate = 2;
> -   }
> +   ret = adreno_get_pwrlevels(dev, &config);
> +   if (ret)
> +   return ret;
>
> dev->platform_data = &config;
> set_gpu_pdev(dev_get_drvdata(master), to_platform_device(dev));
> --
> 1.9.1
>
> __

Re: [Freedreno] [RESEND PATCH] drm/msm: adreno: fix build error without debugfs

2017-03-13 Thread Rob Clark
On Mon, Mar 13, 2017 at 12:43 PM, Arnd Bergmann  wrote:
> The newly added a5xx support fails to build when debugfs is diabled:
>
> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:4: error: 'struct msm_gpu_funcs' 
> has no member named 'show'
> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:11: error: 'a5xx_show' undeclared 
> here (not in a function); did you mean 'a5xx_irq'?
>
> This adds a missing #ifdef.
>
> Fixes: b5f103ab98c7 ("drm/msm: gpu: Add A5XX target support")
> Cc: sta...@vger.kernel.org
> Signed-off-by: Arnd Bergmann 

I thought I had picked this one up already, but I guess my brain was
playing tricks on me.. I've pushed this to msm-next for now and will
cherry-pick this over to a -fixes branch when I send fixes for 4.11..

BR,
-R


> ---
> Originally sent on Nov 30 for v4.10, but I now see this is still required
> on v4.11-rc2
> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
> b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 4414cf73735d..f0c8bd74ca91 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -860,7 +860,9 @@ static const struct adreno_gpu_funcs funcs = {
> .idle = a5xx_idle,
> .irq = a5xx_irq,
> .destroy = a5xx_destroy,
> +#ifdef CONFIG_DEBUG_FS
> .show = a5xx_show,
> +#endif
> },
> .get_timestamp = a5xx_get_timestamp,
>  };
> --
> 2.9.0
>
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


[Freedreno] [RESEND PATCH] drm/msm: adreno: fix build error without debugfs

2017-03-13 Thread Arnd Bergmann
The newly added a5xx support fails to build when debugfs is diabled:

drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:4: error: 'struct msm_gpu_funcs' has 
no member named 'show'
drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:11: error: 'a5xx_show' undeclared 
here (not in a function); did you mean 'a5xx_irq'?

This adds a missing #ifdef.

Fixes: b5f103ab98c7 ("drm/msm: gpu: Add A5XX target support")
Cc: sta...@vger.kernel.org
Signed-off-by: Arnd Bergmann 
---
Originally sent on Nov 30 for v4.10, but I now see this is still required
on v4.11-rc2
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 4414cf73735d..f0c8bd74ca91 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -860,7 +860,9 @@ static const struct adreno_gpu_funcs funcs = {
.idle = a5xx_idle,
.irq = a5xx_irq,
.destroy = a5xx_destroy,
+#ifdef CONFIG_DEBUG_FS
.show = a5xx_show,
+#endif
},
.get_timestamp = a5xx_get_timestamp,
 };
-- 
2.9.0

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno