[PATCH] drm/amd/powerplay: mark symbols static where possible

2016-10-25 Thread Baoyou Xie
On 25 October 2016 at 16:15, Arnd Bergmann  wrote:

> On Tuesday, October 25, 2016 10:31:21 AM CEST Baoyou Xie wrote:
> > On 25 October 2016 at 04:51, Arnd Bergmann  wrote:
> > > On Saturday, October 22, 2016 4:56:22 PM CEST Baoyou Xie wrote:
> > > The function has no callers, so the easiest way would be to remove it
> > > entirely, but it's possible that there are plans to add users soon.
> > >
> > > It was assumed that this function will be used soon, so this patch
> remains
> > it.
> > if it still not be used in 4.10, then we can remove it.
> > is it right?
>
> There is no such rule in general, it's up to the maintainer and
> it depends on the specific reason for why the function ended up
> being unused in the first place.
>
> However, we can expect the maintainer to come up with some solution
> to address the warning. Possible options include:
>
> - calling the function from where it was meant to be used
> - removing the function
> - adding __maybe_unused
> - adding an #if 0
>
> I have not looked at this specific example and do not know
> which of them would be appropriate here. If you look at the
> output of 'git log -p drivers/gpu/drm/amd/amdgpu/../
> powerplay/hwmgr/smu7_hwmgr.c'
> you might find it out yourself.
>
>
Good idea :)

hi, Daniel:
could you tell me the git tree that you use? it's better to work on
your git tree.

Arnd
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161025/87a8f6d9/attachment.html>


[PATCH] drm/amd/powerplay: mark symbols static where possible

2016-10-25 Thread Baoyou Xie
On 25 October 2016 at 04:51, Arnd Bergmann  wrote:

> On Saturday, October 22, 2016 4:56:22 PM CEST Baoyou Xie wrote:
> > @@ -1341,7 +1341,7 @@ int smu7_disable_dpm_tasks(struct pp_hwmgr *hwmgr)
> > return result;
> >  }
> >
> > -int smu7_reset_asic_tasks(struct pp_hwmgr *hwmgr)
> > +static int smu7_reset_asic_tasks(struct pp_hwmgr *hwmgr)
> >  {
> >
> > return 0;
> >
>
> This needs to be done differently:
>
> ../drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1344:12:
> error: 'smu7_reset_asic_tasks' defined but not used
> [-Werror=unused-function]
>
> The function has no callers, so the easiest way would be to remove it
> entirely, but it's possible that there are plans to add users soon.
>
> It was assumed that this function will be used soon, so this patch remains
it.
if it still not be used in 4.10, then we can remove it.
is it right?


> Arnd
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161025/9d0d6ea4/attachment.html>


[PATCH] drm/amd/powerplay: mark symbols static where possible

2016-10-25 Thread Baoyou Xie
On 25 October 2016 at 04:07, Deucher, Alexander 
wrote:

> > -Original Message-
> > From: Arnd Bergmann [mailto:arnd at arndb.de]
> > Sent: Monday, October 24, 2016 3:49 PM
> > To: Alex Deucher
> > Cc: Baoyou Xie; Deucher, Alexander; Dave Airlie; Zhu, Rex; Zhou, Jammy;
> > Huang, JinHuiEric; StDenis, Tom; Edward O'Callaghan; Prosyak, Vitaly;
> Yang,
> > Eric; Yang, Young; Huang, Ray; Dan Carpenter; Cui, Flora; Nils
> Wallménius; Liu,
> > Monk; Wang, Ken; Min, Frank; tang.qiang007 at zte.com.cn;
> > xie.baoyou at zte.com.cn; LKML; Maling list - DRI developers;
> > han.fei at zte.com.cn
> > Subject: Re: [PATCH] drm/amd/powerplay: mark symbols static where
> > possible
> >
> > On Monday, October 24, 2016 12:36:52 PM CEST Alex Deucher wrote:
> > > On Sat, Oct 22, 2016 at 4:56 AM, Baoyou Xie 
> > wrote:
> > > > We get a few warnings when building kernel with W=1:
> > > >
> > drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smumgr.c:162:5:
> > warning: no previous prototype for 'fiji_setup_pwr_virus' [-Wmissing-
> > prototypes]
> > > > drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smc.c:2052:5:
> > warning: no previous prototype for 'fiji_program_mem_timing_parameters'
> > [-Wmissing-prototypes]
> > > >
> > drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c:
> > 175:5: warning: no previous prototype for 'polaris10_avfs_event_mgr' [-
> > Wmissing-prototypes]
> > > >
> > drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_hwmgr.c:1020:5:
> > warning: no previous prototype for 'cz_tf_reset_acp_boot_level' [-
> > Wmissing-prototypes]
> > > >
> > drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:92:26:
> > warning: no previous prototype for 'cast_phw_smu7_power_state' [-
> > Wmissing-prototypes]
> > > > 
> > > >
> > > > In fact, these functions are only used in the file in which they are
> > > > declared and don't need a declaration, but can be made static.
> > > > So this patch marks these functions with 'static'.
> > > >
> > > > Signed-off-by: Baoyou Xie 
> > >
> > > This was already applied the last time you sent it out.  Sorry if I
> > > didn't mention that previously.
> >
> > For some reason the patch hasn't made it into linux-next, so I can see
> > why Baoyou was getting confused here. Can you clarify what the timeline
> > is for the AMD DRM driver patches from between they get applied to the
> > AMD tree to when they make it into linux-next?
> >
>
> It came in late enough last cycle that it didn't make it into 4.9 (this is
> just a clean up not a critical bug fix), so I queued it for 4.10.  I try to
> reply when I apply a patch, but sometimes I miss one here and there.  Once
> Dave starts the drm-next tree for 4.10, it will be included in my pull
> request.  Pending -next patches are in my drm-next--wip
> tree until I send Dave a formal request.
>
> > I've occasionally had a hard time with DRM (and a few other subsystems)
> > with bugfix patches trying to find out whether they got lost or
> > whether they just haven't made it into -next but are in some other tree.
> >
>
> For bug fixes we usually send Dave ~weekly pull requests for each -rc as
> necessary.  For -next stuff, each driver usually sends at least one,
> sometimes several pull requests for the next merge window.
>
> Alex
>
> > Baoyou, when you resend a patch, please try to list explicitly why
> > you are resending it, when it was last sent, and what kind of reply
> > you got (integrating any Ack, listing what changes you did, and
> > if there are no other changes, why you think you have to resend it).
> >
> >   Arnd
>

OK, I see.
Thanks for the detailed reply!
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161025/43f3f22d/attachment-0001.html>


[Nouveau] [PATCH 01/17] drm/nouveau/core: add missing header dependencies

2016-10-25 Thread Baoyou Xie
On 24 October 2016 at 23:43, Karol Herbst  wrote:

> 2016-10-24 9:13 GMT+02:00 Baoyou Xie :
> >
> >
> > On 23 October 2016 at 01:32, Karol Herbst  wrote:
> >>
> >> I think it would be better to squash those commits:
> >> 1. for the includes
> >> 2. for static declerations
> >>
> > OK, I have resent new patch that squash those commits.
> >
>
> thanks, this is much easier to review and keeps the git history clean :)
> Will try to make a test with those patches over the next days, but it
> looks fine as it is already.
>
>
I worked them out on next-20161021.


> >>
> >> 2016-10-22 11:41 GMT+02:00 Baoyou Xie :
> >> > We get 2 warnings when building kernel with W=1:
> >> > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:34:1: warning: no
> previous
> >> > prototype for 'nvkm_firmware_get' [-Wmissing-prototypes]
> >> > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:58:1: warning: no
> previous
> >> > prototype for 'nvkm_firmware_put' [-Wmissing-prototypes]
> >> >
> >> > In fact, these functions are declared in
> >> > drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h.
> >> > So this patch adds missing header dependencies.
> >> >
> >> > Signed-off-by: Baoyou Xie 
> >> > ---
> >> >  drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> >
> >> > diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> >> > b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> >> > index 34ecd4a..058ff46 100644
> >> > --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> >> > +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> >> > @@ -20,6 +20,7 @@
> >> >   * DEALINGS IN THE SOFTWARE.
> >> >   */
> >> >  #include 
> >> > +#include 
> >> >
> >> >  /**
> >> >   * nvkm_firmware_get - load firmware from the official nvidia/chip/
> >> > directory
> >> > --
> >> > 2.7.4
> >> >
> >> > ___
> >> > Nouveau mailing list
> >> > Nouveau at lists.freedesktop.org
> >> > https://lists.freedesktop.org/mailman/listinfo/nouveau
> >
> >
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161025/505381b3/attachment.html>


[Nouveau] [PATCH 01/17] drm/nouveau/core: add missing header dependencies

2016-10-24 Thread Baoyou Xie
On 23 October 2016 at 01:32, Karol Herbst  wrote:

> I think it would be better to squash those commits:
> 1. for the includes
> 2. for static declerations
>
> OK, I have resent new patch that squash those commits.


> 2016-10-22 11:41 GMT+02:00 Baoyou Xie :
> > We get 2 warnings when building kernel with W=1:
> > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:34:1: warning: no previous
> prototype for 'nvkm_firmware_get' [-Wmissing-prototypes]
> > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:58:1: warning: no previous
> prototype for 'nvkm_firmware_put' [-Wmissing-prototypes]
> >
> > In fact, these functions are declared in
> > drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h.
> > So this patch adds missing header dependencies.
> >
> > Signed-off-by: Baoyou Xie 
> > ---
> >  drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> > index 34ecd4a..058ff46 100644
> > --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> > +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> > @@ -20,6 +20,7 @@
> >   * DEALINGS IN THE SOFTWARE.
> >   */
> >  #include 
> > +#include 
> >
> >  /**
> >   * nvkm_firmware_get - load firmware from the official nvidia/chip/
> directory
> > --
> > 2.7.4
> >
> > ___
> > Nouveau mailing list
> > Nouveau at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/nouveau
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161024/c56ef8f4/attachment-0001.html>


[PATCH v2 2/2] drm/nouveau: mark symbols static where possible

2016-10-24 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:29:1: warning: no previous 
prototype for 'nvbios_fan_table' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:56:1: warning: no previous 
prototype for 'nvbios_fan_entry' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c:184:1: warning: no previous 
prototype for 'gt215_clk_info' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:99:1: warning: no previous 
prototype for 'gt215_link_train_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:153:1: warning: no previous 
prototype for 'gt215_link_train' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:271:1: warning: no previous 
prototype for 'gt215_link_train_init' [-Wmissing-prototypes]


In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nouveau_display.c   | 2 +-
 drivers/gpu/drm/nouveau/nv10_fence.c| 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/device/user.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 8 
 drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c  | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c  | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c  | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c   | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c  | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c   | 8 
 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c| 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c| 4 ++--
 17 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c 
b/drivers/gpu/drm/nouveau/nouveau_display.c
index afbf557..b60ee21 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -92,7 +92,7 @@ calc(int blanks, int blanke, int total, int line)
return line;
 }

-int
+static int
 nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime)
 {
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c 
b/drivers/gpu/drm/nouveau/nv10_fence.c
index 4e3de34..619f79d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.c
+++ b/drivers/gpu/drm/nouveau/nv10_fence.c
@@ -66,7 +66,7 @@ nv10_fence_context_del(struct nouveau_channel *chan)
nouveau_fence_context_free(>base);
 }

-int
+static int
 nv10_fence_context_new(struct nouveau_channel *chan)
 {
struct nv10_fence_chan *fctx;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
index 79a8f71..513ee6b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
@@ -326,7 +326,7 @@ nvkm_udevice = {
.sclass = nvkm_udevice_child_get,
 };

-int
+static int
 nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size,
 struct nvkm_object **pobject)
 {
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
index dd2953b..26990d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
@@ -153,7 +153,7 @@ nv50_disp_chan_uevent = {
.fini = nv50_disp_chan_uevent_fini,
 };

-int
+static int
 nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -163,7 +163,7 @@ nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, 
u32 *data)
return 0;
 }

-int
+static int
 nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, u32 data)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -173,7 +173,7 @@ nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, 
u32 data)
return 0;
 }

-int
+static int
 nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
struct nvkm_event **pevent)
 {
@@ -189,7 +189,7 @@ nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
return -EINVAL;
 }

-int
+static int
 nv50_disp_chan_map(struct nvkm_object *object, u64 *addr, u32 *size)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
index 2f9cecd..6424b39 100

[PATCH v2 1/2] drm/nouveau: add missing header dependencies

2016-10-24 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:34:1: warning: no previous 
prototype for 'nvkm_firmware_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:58:1: warning: no previous 
prototype for 'nvkm_firmware_put' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c:69:1: warning: no previous 
prototype for 'nvkm_sddr3_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c:60:1: warning: no previous 
prototype for 'nvkm_sddr2_calc' [-Wmissing-prototypes]


In fact, these functions are declared in
drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h
drivers/gpu/drm/nouveau/dispnv04/disp.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/dispnv04/overlay.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 1 +
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c   | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c   | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c  | 1 +
 6 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c 
b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
index ec444ea..a79514d 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
@@ -33,7 +33,7 @@
 #include "nouveau_connector.h"
 #include "nouveau_display.h"
 #include "nvreg.h"
-
+#include "disp.h"

 struct nouveau_plane {
struct drm_plane base;
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c 
b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index 34ecd4a..058ff46 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include 
+#include 

 /**
  * nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
index 1e13278..c8bb919 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
@@ -106,6 +106,7 @@
 #define CP_SEEK_2  0x00c800ff

 #include "ctxnv40.h"
+#include "nv50.h"

 #include 

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
index b9f1ffd..4dcd874 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
@@ -23,6 +23,7 @@
  *  Ben Skeggs
  */
 #include "priv.h"
+#include "ram.h"

 struct ramxlat {
int id;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
index 2690033..eca8a44 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
@@ -23,6 +23,7 @@
  * Roy Spliet 
  */
 #include "priv.h"
+#include "ram.h"

 struct ramxlat {
int id;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
index d2bac1d..443c031 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include "priv.h"

 static const u8 tags[] = {
DCB_GPIO_VID0, DCB_GPIO_VID1, DCB_GPIO_VID2, DCB_GPIO_VID3,
-- 
2.7.4



[PATCH 17/17] drm/nouveau: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nouveau_display.c:96:1: warning: no previous prototype 
for 'nouveau_display_scanoutpos_head' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nv10_fence.c:70:1: warning: no previous prototype for 
'nv10_fence_context_new' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nouveau_display.c | 2 +-
 drivers/gpu/drm/nouveau/nv10_fence.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c 
b/drivers/gpu/drm/nouveau/nouveau_display.c
index afbf557..b60ee21 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -92,7 +92,7 @@ calc(int blanks, int blanke, int total, int line)
return line;
 }

-int
+static int
 nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime)
 {
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c 
b/drivers/gpu/drm/nouveau/nv10_fence.c
index 4e3de34..619f79d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.c
+++ b/drivers/gpu/drm/nouveau/nv10_fence.c
@@ -66,7 +66,7 @@ nv10_fence_context_del(struct nouveau_channel *chan)
nouveau_fence_context_free(>base);
 }

-int
+static int
 nv10_fence_context_new(struct nouveau_channel *chan)
 {
struct nv10_fence_chan *fctx;
-- 
2.7.4



[PATCH 16/17] drm/nouveau/dispnv04: add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/dispnv04/overlay.c:496:1: warning: no previous 
prototype for 'nouveau_overlay_init' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/gpu/drm/nouveau/dispnv04/disp.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/dispnv04/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c 
b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
index ec444ea..a79514d 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
@@ -33,7 +33,7 @@
 #include "nouveau_connector.h"
 #include "nouveau_display.h"
 #include "nvreg.h"
-
+#include "disp.h"

 struct nouveau_plane {
struct drm_plane base;
-- 
2.7.4



[PATCH 15/17] drm/nouveau/pm: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c:75:1: warning: no previous 
prototype for 'nvkm_perfsig_find' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c:703:1: warning: no previous 
prototype for 'nvkm_perfsrc_new' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
index 8616636..dde89a4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
@@ -71,7 +71,7 @@ nvkm_perfdom_find(struct nvkm_pm *pm, int di)
return NULL;
 }

-struct nvkm_perfsig *
+static struct nvkm_perfsig *
 nvkm_perfsig_find(struct nvkm_pm *pm, u8 di, u8 si, struct nvkm_perfdom **pdom)
 {
struct nvkm_perfdom *dom = *pdom;
@@ -699,7 +699,7 @@ nvkm_pm_oclass_get(struct nvkm_oclass *oclass, int index,
return 1;
 }

-int
+static int
 nvkm_perfsrc_new(struct nvkm_pm *pm, struct nvkm_perfsig *sig,
 const struct nvkm_specsrc *spec)
 {
-- 
2.7.4



[PATCH 14/17] drm/nouveau/gr: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 5 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:1388:1: warning: no previous 
prototype for 'gf100_gr_init_fw' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:1705:1: warning: no previous 
prototype for 'gf100_gr_init_' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c:312:1: warning: no previous 
prototype for 'gm107_gr_init' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c:222:1: warning: no previous 
prototype for 'gf117_grctx_generate_main' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c:937:1: warning: no previous 
prototype for 'gm107_grctx_generate_tpcid' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c| 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c| 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c
index c925ade..74a64e3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c
@@ -218,7 +218,7 @@ gf117_grctx_generate_attrib(struct gf100_grctx *info)
}
 }

-void
+static void
 gf117_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
 {
struct nvkm_device *device = gr->base.engine.subdev.device;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c
index 6d3c501..4c4b5ab 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c
@@ -933,7 +933,7 @@ gm107_grctx_generate_attrib(struct gf100_grctx *info)
}
 }

-void
+static void
 gm107_grctx_generate_tpcid(struct gf100_gr *gr)
 {
struct nvkm_device *device = gr->base.engine.subdev.device;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
index 157919c..eccdee0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
@@ -1384,7 +1384,7 @@ gf100_gr_intr(struct nvkm_gr *base)
nvkm_fifo_chan_put(device->fifo, flags, );
 }

-void
+static void
 gf100_gr_init_fw(struct gf100_gr *gr, u32 fuc_base,
 struct gf100_gr_fuc *code, struct gf100_gr_fuc *data)
 {
@@ -1701,7 +1701,7 @@ gf100_gr_oneinit(struct nvkm_gr *base)
return 0;
 }

-int
+static int
 gf100_gr_init_(struct nvkm_gr *base)
 {
struct gf100_gr *gr = gf100_gr(base);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
index 45f965f..2c67fac 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
@@ -308,7 +308,7 @@ gm107_gr_init_bios(struct gf100_gr *gr)
}
 }

-int
+static int
 gm107_gr_init(struct gf100_gr *gr)
 {
struct nvkm_device *device = gr->base.engine.subdev.device;
-- 
2.7.4



[PATCH 13/17] drm/nouveau/gr: add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c:255:1: warning: no previous 
prototype for 'nv50_grctx_fill' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c:265:1: warning: no previous 
prototype for 'nv50_grctx_init' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
index 1e13278..c8bb919 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
@@ -106,6 +106,7 @@
 #define CP_SEEK_2  0x00c800ff

 #include "ctxnv40.h"
+#include "nv50.h"

 #include 

-- 
2.7.4



[PATCH 12/17] drm/nouveau/fifo: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c:133:1: warning: no previous 
prototype for 'g84_fifo_chan_engine_init' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c:174:1: warning: no previous 
prototype for 'g84_fifo_chan_object_ctor' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c
index aeb3387..15a992b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c
@@ -129,7 +129,7 @@ g84_fifo_chan_engine_fini(struct nvkm_fifo_chan *base,
 }


-int
+static int
 g84_fifo_chan_engine_init(struct nvkm_fifo_chan *base,
  struct nvkm_engine *engine)
 {
@@ -170,7 +170,7 @@ g84_fifo_chan_engine_ctor(struct nvkm_fifo_chan *base,
return nvkm_object_bind(object, NULL, 0, >engn[engn]);
 }

-int
+static int
 g84_fifo_chan_object_ctor(struct nvkm_fifo_chan *base,
  struct nvkm_object *object)
 {
-- 
2.7.4



[PATCH 11/17] drm/nouveau/disp: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 5 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c:70:1: warning: no previous 
prototype for 'nv50_disp_root_mthd_' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c:157:1: warning: no previous 
prototype for 'nv50_disp_chan_rd32' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c:167:1: warning: no previous 
prototype for 'nv50_disp_chan_wr32' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c:177:1: warning: no previous 
prototype for 'nv50_disp_chan_ntfy' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c:193:1: warning: no previous 
prototype for 'nv50_disp_chan_map' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 8 
 drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
index dd2953b..26990d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
@@ -153,7 +153,7 @@ nv50_disp_chan_uevent = {
.fini = nv50_disp_chan_uevent_fini,
 };

-int
+static int
 nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -163,7 +163,7 @@ nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, 
u32 *data)
return 0;
 }

-int
+static int
 nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, u32 data)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -173,7 +173,7 @@ nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, 
u32 data)
return 0;
 }

-int
+static int
 nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
struct nvkm_event **pevent)
 {
@@ -189,7 +189,7 @@ nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
return -EINVAL;
 }

-int
+static int
 nv50_disp_chan_map(struct nvkm_object *object, u64 *addr, u32 *size)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
index 2f9cecd..6424b39 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
@@ -66,7 +66,7 @@ nv50_disp_root_scanoutpos(NV50_DISP_MTHD_V0)
return 0;
 }

-int
+static int
 nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 
size)
 {
union {
-- 
2.7.4



[PATCH 10/17] drm/nouveau/device: mark symbol static where possible

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:330:1: warning: no previous 
prototype for 'nvkm_udevice_new' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
index 79a8f71..513ee6b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
@@ -326,7 +326,7 @@ nvkm_udevice = {
.sclass = nvkm_udevice_child_get,
 };

-int
+static int
 nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size,
 struct nvkm_object **pobject)
 {
-- 
2.7.4



[PATCH 09/17] drm/nouveau/volt: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c:38:1: warning: no previous 
prototype for 'gk104_volt_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c:51:1: warning: no previous 
prototype for 'gk104_volt_set' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c
index 420bd84..1527d12 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c
@@ -34,7 +34,7 @@ struct gk104_volt {
struct nvbios_volt bios;
 };

-int
+static int
 gk104_volt_get(struct nvkm_volt *base)
 {
struct nvbios_volt *bios = _volt(base)->bios;
@@ -47,7 +47,7 @@ gk104_volt_get(struct nvkm_volt *base)
return bios->base + bios->pwm_range * duty / div;
 }

-int
+static int
 gk104_volt_set(struct nvkm_volt *base, u32 uv)
 {
struct nvbios_volt *bios = _volt(base)->bios;
-- 
2.7.4



[PATCH 08/17] drm/nouveau/volt: add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get 3 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c:35:1: warning: no previous 
prototype for 'nvkm_voltgpio_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c:54:1: warning: no previous 
prototype for 'nvkm_voltgpio_set' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c:71:1: warning: no previous 
prototype for 'nvkm_voltgpio_init' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
index d2bac1d..443c031 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include "priv.h"

 static const u8 tags[] = {
DCB_GPIO_VID0, DCB_GPIO_VID1, DCB_GPIO_VID2, DCB_GPIO_VID3,
-- 
2.7.4



[PATCH 07/17] drm/nouveau/secboot: mark symbol static where possible

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c:1368:1: warning: no 
previous prototype for 'gm200_secboot_fini' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c
index f1e2dc9..ec48e4a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c
@@ -1364,7 +1364,7 @@ gm200_secboot_init(struct nvkm_secboot *sb)
return 0;
 }

-int
+static int
 gm200_secboot_fini(struct nvkm_secboot *sb, bool suspend)
 {
struct gm200_secboot *gsb = gm200_secboot(sb);
-- 
2.7.4



[PATCH 06/17] drm/nouveau/gpio: mark symbol static where possible

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c:41:1: warning: no previous 
prototype for 'gk104_gpio_intr_mask' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c
index 3f45afd1..2ead515 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c
@@ -37,7 +37,7 @@ gk104_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo)
nvkm_wr32(device, 0x00dc80, intr1);
 }

-void
+static void
 gk104_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
 {
struct nvkm_device *device = gpio->subdev.device;
-- 
2.7.4



[PATCH 05/17] drm/nouveau/fb: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:99:1: warning: no previous 
prototype for 'gt215_link_train_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:153:1: warning: no previous 
prototype for 'gt215_link_train' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:271:1: warning: no previous 
prototype for 'gt215_link_train_init' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:337:1: warning: no previous 
prototype for 'gt215_link_train_fini' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
index d15ea88..f106643 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
@@ -95,7 +95,7 @@ struct gt215_ram {
struct gt215_ltrain ltrain;
 };

-void
+static void
 gt215_link_train_calc(u32 *vals, struct gt215_ltrain *train)
 {
int i, lo, hi;
@@ -149,7 +149,7 @@ gt215_link_train_calc(u32 *vals, struct gt215_ltrain *train)
 /*
  * Link training for (at least) DDR3
  */
-int
+static int
 gt215_link_train(struct gt215_ram *ram)
 {
struct gt215_ltrain *train = >ltrain;
@@ -267,7 +267,7 @@ gt215_link_train(struct gt215_ram *ram)
return ret;
 }

-int
+static int
 gt215_link_train_init(struct gt215_ram *ram)
 {
static const u32 pattern[16] = {
@@ -333,7 +333,7 @@ gt215_link_train_init(struct gt215_ram *ram)
return 0;
 }

-void
+static void
 gt215_link_train_fini(struct gt215_ram *ram)
 {
if (ram->ltrain.mem)
-- 
2.7.4



[PATCH 04/17] drm/nouveau/fb: add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c:69:1: warning: no previous 
prototype for 'nvkm_sddr3_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c:60:1: warning: no previous 
prototype for 'nvkm_sddr2_calc' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
index b9f1ffd..4dcd874 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
@@ -23,6 +23,7 @@
  *  Ben Skeggs
  */
 #include "priv.h"
+#include "ram.h"

 struct ramxlat {
int id;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
index 2690033..eca8a44 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
@@ -23,6 +23,7 @@
  * Roy Spliet 
  */
 #include "priv.h"
+#include "ram.h"

 struct ramxlat {
int id;
-- 
2.7.4



[PATCH 03/17] drm/nouveau/clk: mark symbol static where possible

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c:184:1: warning: no previous 
prototype for 'gt215_clk_info' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c
index 056702e..96e0941 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c
@@ -180,7 +180,7 @@ gt215_clk_read(struct nvkm_clk *base, enum nv_clk_src src)
return 0;
 }

-int
+static int
 gt215_clk_info(struct nvkm_clk *base, int idx, u32 khz,
   struct gt215_clk_info *info)
 {
-- 
2.7.4



[PATCH 02/17] drm/nouveau/bios: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:29:1: warning: no previous 
prototype for 'nvbios_fan_table' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:56:1: warning: no previous 
prototype for 'nvbios_fan_entry' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c
index 80fed7e..e290581 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c
@@ -25,7 +25,7 @@
 #include 
 #include 

-u16
+static u16
 nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
 {
struct bit_entry bit_P;
@@ -52,7 +52,7 @@ nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 
*cnt, u8 *len)
return 0x;
 }

-u16
+static u16
 nvbios_fan_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
 u8 *cnt, u8 *len)
 {
-- 
2.7.4



[PATCH 01/17] drm/nouveau/core: add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:34:1: warning: no previous 
prototype for 'nvkm_firmware_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:58:1: warning: no previous 
prototype for 'nvkm_firmware_put' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c 
b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index 34ecd4a..058ff46 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include 
+#include 

 /**
  * nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
-- 
2.7.4



[PATCH 1/2] drm/msm: add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/msm_debugfs.c:141:5: warning: no previous prototype for 
'msm_debugfs_init' [-Wmissing-prototypes]
drivers/gpu/drm/msm/msm_debugfs.c:158:6: warning: no previous prototype for 
'msm_debugfs_cleanup' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/msm/msm_debugfs.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/msm/msm_debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/msm_debugfs.c 
b/drivers/gpu/drm/msm/msm_debugfs.c
index 663f2b6..3c85373 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -18,6 +18,7 @@
 #ifdef CONFIG_DEBUG_FS
 #include "msm_drv.h"
 #include "msm_gpu.h"
+#include "msm_debugfs.h"

 static int msm_gpu_show(struct drm_device *dev, struct seq_file *m)
 {
-- 
2.7.4



[PATCH 2/2] drm/msm/adreno: move function declarations to header file

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/adreno/a3xx_gpu.c:535:17: warning: no previous prototype 
for 'a3xx_gpu_init' [-Wmissing-prototypes]
drivers/gpu/drm/msm/adreno/a4xx_gpu.c:624:17: warning: no previous prototype 
for 'a4xx_gpu_init' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/msm/adreno/adreno_device.c, but should be declared
in a header file. So this patch moves both function declarations to
drivers/gpu/drm/msm/adreno/adreno_gpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/msm/adreno/adreno_device.c | 3 ---
 drivers/gpu/drm/msm/adreno/adreno_gpu.h| 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 5127b75..7250ffc 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -25,9 +25,6 @@ bool hang_debug = false;
 MODULE_PARM_DESC(hang_debug, "Dump registers when hang is detected (can be 
slow!)");
 module_param_named(hang_debug, hang_debug, bool, 0600);

-struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
-struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
-
 static const struct adreno_info gpulist[] = {
{
.rev   = ADRENO_REV(3, 0, 5, ANY_ID),
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index a54f6e0..07d99bd 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -311,4 +311,7 @@ static inline void adreno_gpu_write(struct adreno_gpu *gpu,
gpu_write(>base, reg - 1, data);
 }

+struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
+struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
+
 #endif /* __ADRENO_GPU_H__ */
-- 
2.7.4



[PATCH] drm/i2c/tda998x: mark symbol static where possible

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/i2c/tda998x_drv.c:1292:5: warning: no previous prototype for 
'tda998x_audio_digital_mute' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 9798d40..af8683e 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1289,7 +1289,8 @@ static void tda998x_audio_shutdown(struct device *dev, 
void *data)
mutex_unlock(>audio_mutex);
 }

-int tda998x_audio_digital_mute(struct device *dev, void *data, bool enable)
+static int
+tda998x_audio_digital_mute(struct device *dev, void *data, bool enable)
 {
struct tda998x_priv *priv = dev_get_drvdata(dev);

-- 
2.7.4



[PATCH] drm/arm: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 
'malidp_duplicate_plane_state' [-Wmissing-prototypes]
drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 
'malidp_destroy_plane_state' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/arm/malidp_planes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c 
b/drivers/gpu/drm/arm/malidp_planes.c
index 82c193e..5339e87 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
devm_kfree(plane->dev->dev, mp);
 }

-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct
+drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
struct malidp_plane_state *state, *m_state;

@@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct 
drm_plane *plane)
return >base;
 }

-void malidp_destroy_plane_state(struct drm_plane *plane,
+static void malidp_destroy_plane_state(struct drm_plane *plane,
struct drm_plane_state *state)
 {
struct malidp_plane_state *m_state = to_malidp_plane_state(state);
-- 
2.7.4



[PATCH] drm/arm: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 
'malidp_duplicate_plane_state' [-Wmissing-prototypes]
drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 
'malidp_destroy_plane_state' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/arm/malidp_planes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c 
b/drivers/gpu/drm/arm/malidp_planes.c
index 82c193e..5339e87 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
devm_kfree(plane->dev->dev, mp);
 }

-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct
+drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
struct malidp_plane_state *state, *m_state;

@@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct 
drm_plane *plane)
return >base;
 }

-void malidp_destroy_plane_state(struct drm_plane *plane,
+static void malidp_destroy_plane_state(struct drm_plane *plane,
struct drm_plane_state *state)
 {
struct malidp_plane_state *m_state = to_malidp_plane_state(state);
-- 
2.7.4



[PATCH] drm/armada: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/armada/armada_gem.c:215:27: warning: no previous prototype for 
'armada_gem_alloc_object' [-Wmissing-prototypes]
drivers/gpu/drm/armada/armada_gem.c:423:1: warning: no previous prototype for 
'armada_gem_prime_map_dma_buf' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/armada/armada_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index 8067918..63c3a14 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -212,7 +212,7 @@ armada_gem_alloc_private_object(struct drm_device *dev, 
size_t size)
return obj;
 }

-struct armada_gem_object *armada_gem_alloc_object(struct drm_device *dev,
+static struct armada_gem_object *armada_gem_alloc_object(struct drm_device 
*dev,
size_t size)
 {
struct armada_gem_object *obj;
@@ -419,7 +419,7 @@ int armada_gem_pwrite_ioctl(struct drm_device *dev, void 
*data,
 }

 /* Prime support */
-struct sg_table *
+static struct sg_table *
 armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
enum dma_data_direction dir)
 {
-- 
2.7.4



[PATCH] drm/amd/powerplay: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smumgr.c:162:5: warning: no 
previous prototype for 'fiji_setup_pwr_virus' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smc.c:2052:5: warning: no 
previous prototype for 'fiji_program_mem_timing_parameters' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c:175:5: 
warning: no previous prototype for 'polaris10_avfs_event_mgr' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_hwmgr.c:1020:5: warning: no 
previous prototype for 'cz_tf_reset_acp_boot_level' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:92:26: warning: no 
previous prototype for 'cast_phw_smu7_power_state' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c  |  6 ++-
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 12 +++---
 .../amd/powerplay/hwmgr/process_pptables_v1_0.c|  6 +--
 .../gpu/drm/amd/powerplay/hwmgr/processpptables.c  |  4 +-
 .../amd/powerplay/hwmgr/smu7_clockpowergating.c| 10 ++---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   | 49 --
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c|  2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 12 +++---
 .../drm/amd/powerplay/smumgr/polaris10_smumgr.c|  5 ++-
 9 files changed, 57 insertions(+), 49 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c 
b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 7174f7a..eecfbc5 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -436,7 +436,9 @@ static enum PP_StateUILabel power_state_convert(enum 
amd_pm_state_type  state)
}
 }

-int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event event_id, void 
*input, void *output)
+static int
+pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event event_id, void *input,
+ void *output)
 {
int ret = 0;
struct pp_instance *pp_handle;
@@ -475,7 +477,7 @@ int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event 
event_id, void *input,
return ret;
 }

-enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
+static enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
 {
struct pp_hwmgr *hwmgr;
struct pp_power_state *state;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index 9604249..4b14f25 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -66,7 +66,7 @@ static const struct cz_power_state 
*cast_const_PhwCzPowerState(
return (struct cz_power_state *)hw_ps;
 }

-uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
+static uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
uint32_t clock, uint32_t msg)
 {
int i = 0;
@@ -1017,7 +1017,7 @@ static int cz_tf_program_bootup_state(struct pp_hwmgr 
*hwmgr, void *input,
return 0;
 }

-int cz_tf_reset_acp_boot_level(struct pp_hwmgr *hwmgr, void *input,
+static int cz_tf_reset_acp_boot_level(struct pp_hwmgr *hwmgr, void *input,
void *output, void *storage, int result)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
@@ -1225,7 +1225,7 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1239,7 +1239,7 @@ int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
+static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
struct phm_clock_voltage_dependency_table *table =
@@ -1277,7 +1277,7 @@ int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1533,7 +1533,7 @@ static int cz_dpm_get_pp_table_entry(struct pp_hwmgr 
*hwmgr,
return result;
 }

-int cz_get_power_state_size(struct pp_hwmgr *hwmgr)
+static int cz_get_power_state_size(struct pp_hwmgr *hwmgr)
 {
return sizeof(struct cz_power_state);
 }
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c 
b/drivers/gpu/drm/amd/pow

[PATCH 3/3] drm/amdgpu: move function declaration to header file

2016-10-22 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:37:6: warning: no previous prototype for 
'amdgpu_pm_acpi_event_handler' [-Wmissing-prototypes]

In fact, this function is defined in
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c, but should be declared
in a header file. So this patch moves the function declaration
to drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h  | 2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 039b57e..c0bc42b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -2145,6 +2145,8 @@ void amdgpu_io_wreg(struct amdgpu_device *adev, u32 reg, 
u32 v);
 u32 amdgpu_mm_rdoorbell(struct amdgpu_device *adev, u32 index);
 void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v);

+void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
+
 /*
  * Registers read & write functions.
  */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 5796539..d77d630 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -33,7 +33,6 @@
 #include "amd_acpi.h"
 #include "atom.h"

-extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
 /* Call the ATIF method
  */
 /**
-- 
2.7.4



[PATCH 2/3] drm/amdgpu: mark symbols static where possible

2016-10-22 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/si.c:908:5: warning: no previous prototype for 
'si_pciep_rreg' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/si.c:921:6: warning: no previous prototype for 
'si_pciep_wreg' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/si.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index dc9511c..bacdff8 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -905,7 +905,7 @@ static void si_pcie_wreg(struct amdgpu_device *adev, u32 
reg, u32 v)
spin_unlock_irqrestore(>pcie_idx_lock, flags);
 }

-u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
+static u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
 {
unsigned long flags;
u32 r;
@@ -918,7 +918,7 @@ u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
return r;
 }

-void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
+static void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
 {
unsigned long flags;

-- 
2.7.4



[PATCH 1/3] drm/amdgpu: change function declarations and add missing header dependencies

2016-10-22 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/atombios_crtc.c:38:6: warning: no previous prototype 
for 'amdgpu_atombios_crtc_overscan_setup' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c:661:6: warning: no previous prototype for 
'dce_v8_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:40:5: warning: no previous prototype 
for 'amdgpu_gfx_scratch_get' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:62:6: warning: no previous prototype 
for 'amdgpu_gfx_scratch_free' [-Wmissing-prototypes]


In fact, these functions are declared in
drivers/gpu/drm/amd/amdgpu/atombios_crtc.h
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
drivers/gpu/drm/amd/amdgpu/dce_v8_0.h
drivers/gpu/drm/amd/amdgpu/dce_v10_0.h
drivers/gpu/drm/amd/amdgpu/dce_v11_0.h
drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h.
So this patch adds missing header dependencies.

By the way, this patch changes declaration of amdgpu_gfx_parse_disable_cu()
to subject to its implement, and clean three function declarations
in pp_acpi.h up.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c   | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h   | 3 ++-
 drivers/gpu/drm/amd/amdgpu/atombios_crtc.c| 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c| 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c| 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 1 +
 drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c | 1 +
 drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h   | 9 +++--
 8 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index a074edd..01a42b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -24,6 +24,7 @@
  */
 #include 
 #include "amdgpu.h"
+#include "amdgpu_gfx.h"

 /*
  * GPU scratch registers helpers function.
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 51321e1..abd9432 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -27,6 +27,7 @@
 int amdgpu_gfx_scratch_get(struct amdgpu_device *adev, uint32_t *reg);
 void amdgpu_gfx_scratch_free(struct amdgpu_device *adev, uint32_t reg);

-unsigned amdgpu_gfx_parse_disable_cu(unsigned *mask, unsigned max_se, unsigned 
max_sh);
+void amdgpu_gfx_parse_disable_cu(unsigned int *mask, unsigned int max_se,
+   unsigned int max_sh);

 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c 
b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c
index f7d236f..8c9bc75 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c
@@ -31,6 +31,7 @@
 #include "atom.h"
 #include "atom-bits.h"
 #include "atombios_encoders.h"
+#include "atombios_crtc.h"
 #include "amdgpu_atombios.h"
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index 4108c68..443b35f 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -31,6 +31,7 @@
 #include "atombios_encoders.h"
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"
+#include "dce_v10_0.h"

 #include "dce/dce_10_0_d.h"
 #include "dce/dce_10_0_sh_mask.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index f264b8f..d58638c 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -31,6 +31,7 @@
 #include "atombios_encoders.h"
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"
+#include "dce_v11_0.h"

 #include "dce/dce_11_0_d.h"
 #include "dce/dce_11_0_sh_mask.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 5966166..dd5838c 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -31,6 +31,7 @@
 #include "atombios_encoders.h"
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"
+#include "dce_v8_0.h"

 #include "dce/dce_8_0_d.h"
 #include "dce/dce_8_0_sh_mask.h"
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
index 1944d28..f5e8fda 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
@@ -25,6 +25,7 @@
 #include "linux/delay.h"
 #include "hwmgr.h"
 #include "amd_acpi.h"
+#include "pp_acpi.h"

 bool acpi_atcs_functions_supported(void *device, uint32_t index)
 {
diff --

[PATCH] drm/amdgpu: mark symbols static where possible

2016-09-30 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/si.c:908:5: warning: no previous prototype for 
'si_pciep_rreg' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/si.c:921:6: warning: no previous prototype for 
'si_pciep_wreg' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/si.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index dc9511c..bacdff8 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -905,7 +905,7 @@ static void si_pcie_wreg(struct amdgpu_device *adev, u32 
reg, u32 v)
spin_unlock_irqrestore(>pcie_idx_lock, flags);
 }

-u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
+static u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
 {
unsigned long flags;
u32 r;
@@ -918,7 +918,7 @@ u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
return r;
 }

-void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
+static void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
 {
unsigned long flags;

-- 
2.7.4



[PATCH 1/2] drm/amd/powerplay: mark symbols static where possible

2016-09-30 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smumgr.c:162:5: warning: no 
previous prototype for 'fiji_setup_pwr_virus' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smc.c:2052:5: warning: no 
previous prototype for 'fiji_program_mem_timing_parameters' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c:175:5: 
warning: no previous prototype for 'polaris10_avfs_event_mgr' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_hwmgr.c:69:10: warning: no 
previous prototype for 'cz_get_eclk_level' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:92:26: warning: no 
previous prototype for 'cast_phw_smu7_power_state' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c  |  5 ++-
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 12 +++---
 .../amd/powerplay/hwmgr/process_pptables_v1_0.c|  6 +--
 .../gpu/drm/amd/powerplay/hwmgr/processpptables.c  |  4 +-
 .../amd/powerplay/hwmgr/smu7_clockpowergating.c| 10 ++---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   | 45 --
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c|  2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 12 +++---
 .../drm/amd/powerplay/smumgr/polaris10_smumgr.c|  5 ++-
 9 files changed, 54 insertions(+), 47 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c 
b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 7174f7a..bb8a345 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -436,7 +436,8 @@ static enum PP_StateUILabel power_state_convert(enum 
amd_pm_state_type  state)
}
 }

-int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event event_id, void 
*input, void *output)
+static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event event_id,
+   void *input, void *output)
 {
int ret = 0;
struct pp_instance *pp_handle;
@@ -475,7 +476,7 @@ int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event 
event_id, void *input,
return ret;
 }

-enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
+static enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
 {
struct pp_hwmgr *hwmgr;
struct pp_power_state *state;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index 7e4fcbb..b48d00f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -66,7 +66,7 @@ static const struct cz_power_state 
*cast_const_PhwCzPowerState(
return (struct cz_power_state *)hw_ps;
 }

-uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
+static uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
uint32_t clock, uint32_t msg)
 {
int i = 0;
@@ -1017,7 +1017,7 @@ static int cz_tf_program_bootup_state(struct pp_hwmgr 
*hwmgr, void *input,
return 0;
 }

-int cz_tf_reset_acp_boot_level(struct pp_hwmgr *hwmgr, void *input,
+static int cz_tf_reset_acp_boot_level(struct pp_hwmgr *hwmgr, void *input,
void *output, void *storage, int result)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
@@ -1225,7 +1225,7 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1239,7 +1239,7 @@ int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
+static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
struct phm_clock_voltage_dependency_table *table =
@@ -1277,7 +1277,7 @@ int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1533,7 +1533,7 @@ static int cz_dpm_get_pp_table_entry(struct pp_hwmgr 
*hwmgr,
return result;
 }

-int cz_get_power_state_size(struct pp_hwmgr *hwmgr)
+static int cz_get_power_state_size(struct pp_hwmgr *hwmgr)
 {
return sizeof(struct cz_power_state);
 }
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_

[PATCH 2/2] drm/amd/powerplay: remove unused functions

2016-09-30 Thread Baoyou Xie
We get 10 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:65:6: 
warning: no previous prototype for 'cz_phm_is_safe_for_asic_block' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:71:5: 
warning: no previous prototype for 'cz_phm_enable_disable_gfx_power_gating' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:76:5: 
warning: no previous prototype for 'cz_phm_smu_power_up_down_pcie' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:82:5: 
warning: no previous prototype for 'cz_phm_initialize_display_phy_access' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:88:5: 
warning: no previous prototype for 'cz_phm_get_display_phy_access_info' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:94:5: 
warning: no previous prototype for 'cz_phm_gate_unused_display_phys' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:100:5: 
warning: no previous prototype for 'cz_phm_ungate_all_display_phys' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1278:5: warning: no 
previous prototype for 'smu7_disable_dpm_tasks' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1336:5: warning: no 
previous prototype for 'smu7_reset_asic_tasks' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/eventmgr/eventtasks.c:322:5: warning: 
no previous prototype for 'pem_task_enable_clock_power_gating' 
[-Wmissing-prototypes]

In fact, these functions are called by no one and not exported,
so this patch removes them.

Signed-off-by: Baoyou Xie 
---
 .../gpu/drm/amd/powerplay/eventmgr/eventtasks.c|   7 -
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c  |  42 -
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   | 206 -
 .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c   |  59 --
 .../gpu/drm/amd/powerplay/hwmgr/smu7_powertune.h   |   2 -
 5 files changed, 316 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c 
b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c
index b6f45fd..03e5c02 100644
--- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c
+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c
@@ -319,13 +319,6 @@ int pem_task_disable_cgpg(struct pp_eventmgr *eventmgr, 
struct pem_event_data *e
return 0;
 }

-int pem_task_enable_clock_power_gating(struct pp_eventmgr *eventmgr, struct 
pem_event_data *event_data)
-{
-   /* TODO */
-   return 0;
-}
-
-
 int pem_task_enable_gfx_clock_gating(struct pp_eventmgr *eventmgr, struct 
pem_event_data *event_data)
 {
/* TODO */
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
index 2028980..0966fc8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
@@ -61,48 +61,6 @@ int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, 
enum PHM_AsicBlock bloc
return ret;
 }

-
-bool cz_phm_is_safe_for_asic_block(struct pp_hwmgr *hwmgr, const struct 
pp_hw_power_state *state, enum PHM_AsicBlock block)
-{
-   return true;
-}
-
-
-int cz_phm_enable_disable_gfx_power_gating(struct pp_hwmgr *hwmgr, bool enable)
-{
-   return 0;
-}
-
-int cz_phm_smu_power_up_down_pcie(struct pp_hwmgr *hwmgr, uint32_t target, 
bool up, uint32_t args)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_initialize_display_phy_access(struct pp_hwmgr *hwmgr, bool 
initialize, bool accesshw)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_get_display_phy_access_info(struct pp_hwmgr *hwmgr)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_gate_unused_display_phys(struct pp_hwmgr *hwmgr)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_ungate_all_display_phys(struct pp_hwmgr *hwmgr)
-{
-   /* TODO */
-   return 0;
-}
-
 static int cz_tf_uvd_power_gating_initialize(struct pp_hwmgr *hwmgr, void 
*pInput, void *pOutput, void *pStorage, int Result)
 {
return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 649fdd3..1c85925 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -409,34 +409,6 @@ static int smu7_program_voting_clients(struct pp_hwmgr 
*hwmgr)
return 0;
 }

-static int smu7_clear_voting_clients(struct pp_hwmgr *hwmgr)
-{
-   /* Reset voting clients before disabling DPM */
-   PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,
-   SCLK_PWRMGT_CNTL, RESET_SCLK_CNT, 1);
-   PHM_WRITE_INDIRECT_FIELD(hwmgr->device, CGS_IND_RE

[PATCH 2/3] drm/radeon: clean function declarations up

2016-09-30 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/radeon/radeon_device.c:642:6: warning: no previous prototype 
for 'radeon_device_is_virtual' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:56:5: warning: no previous prototype for 
'radeon_driver_unload_kms' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:97:5: warning: no previous prototype for 
'radeon_driver_load_kms' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:612:6: warning: no previous prototype for 
'radeon_driver_lastclose_kms' [-Wmissing-prototypes]


In fact, these functions are declared in some source files,
but should be declared in a header file,
thus can be recognized in other file.

So this patch declares them in drivers/gpu/drm/radeon/radeon.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/atombios_encoders.c |   4 -
 drivers/gpu/drm/radeon/btc_dpm.c   |   4 -
 drivers/gpu/drm/radeon/ci_dpm.c|  10 --
 drivers/gpu/drm/radeon/cik.c   |  14 --
 drivers/gpu/drm/radeon/cik_sdma.c  |   2 -
 drivers/gpu/drm/radeon/cypress_dpm.c   |   4 -
 drivers/gpu/drm/radeon/evergreen.c |  11 --
 drivers/gpu/drm/radeon/evergreen_cs.c  |   2 -
 drivers/gpu/drm/radeon/evergreen_dma.c |   2 -
 drivers/gpu/drm/radeon/kv_dpm.c|   5 -
 drivers/gpu/drm/radeon/ni.c|  11 --
 drivers/gpu/drm/radeon/ni_dma.c|   2 -
 drivers/gpu/drm/radeon/ni_dpm.c|   3 -
 drivers/gpu/drm/radeon/r600.c  |   2 -
 drivers/gpu/drm/radeon/r600_dma.c  |   2 -
 drivers/gpu/drm/radeon/radeon.h| 207 +
 drivers/gpu/drm/radeon/radeon_acpi.c   |   2 -
 drivers/gpu/drm/radeon/radeon_asic.h   |   9 --
 drivers/gpu/drm/radeon/radeon_atombios.c   |   9 --
 drivers/gpu/drm/radeon/radeon_audio.c  |  63 -
 drivers/gpu/drm/radeon/radeon_encoders.c   |   8 --
 drivers/gpu/drm/radeon/radeon_i2c.c|   4 -
 drivers/gpu/drm/radeon/radeon_kms.c|   6 +-
 drivers/gpu/drm/radeon/radeon_object.c |   2 -
 drivers/gpu/drm/radeon/rv730_dpm.c |   3 -
 drivers/gpu/drm/radeon/rv740_dpm.c |   2 -
 drivers/gpu/drm/radeon/si.c|  10 --
 drivers/gpu/drm/radeon/si_dma.c|   2 -
 drivers/gpu/drm/radeon/si_dpm.c|   8 --
 drivers/gpu/drm/radeon/sumo_smc.c  |   2 -
 drivers/gpu/drm/radeon/trinity_dpm.c   |   1 -
 31 files changed, 210 insertions(+), 206 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index fa4f8f0..2bbb916 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -291,10 +291,6 @@ static void radeon_atom_backlight_exit(struct 
radeon_encoder *encoder)

 #endif

-/* evil but including atombios.h is much worse */
-bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
-   struct drm_display_mode *mode);
-
 static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
   const struct drm_display_mode *mode,
   struct drm_display_mode *adjusted_mode)
diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index 38e5123..2b08cfd 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -47,10 +47,6 @@
 #ifndef BTC_MGCG_SEQUENCE
 #define BTC_MGCG_SEQUENCE  300

-struct rv7xx_ps *rv770_get_ps(struct radeon_ps *rps);
-struct rv7xx_power_info *rv770_get_pi(struct radeon_device *rdev);
-struct evergreen_power_info *evergreen_get_pi(struct radeon_device *rdev);
-
 extern int ni_mc_load_microcode(struct radeon_device *rdev);

 //* BARTS **//
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 7ba4508..57ac808 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -165,16 +165,6 @@ static const struct ci_pt_config_reg didt_config_ci[] =
 extern u8 rv770_get_memory_module_index(struct radeon_device *rdev);
 extern int ni_copy_and_switch_arb_sets(struct radeon_device *rdev,
   u32 arb_freq_src, u32 arb_freq_dest);
-extern u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock);
-extern u8 si_get_mclk_frequency_ratio(u32 memory_clock, bool strobe_mode);
-extern void si_trim_voltage_table_to_fit_state_table(struct radeon_device 
*rdev,
-u32 max_voltage_steps,
-struct atom_voltage_table 
*voltage_table);
-extern void cik_enter_rlc_safe_mode(struct radeon_device *rdev);
-extern void cik_exit_rlc_safe_mode(struct radeon_device *rdev);
-extern int ci_mc_load_microcode(struct radeon_device *rdev);
-extern void cik_update_cg(struct radeon_device *rdev,
- u32 block, bool enable

[PATCH 3/3] drm/radeon: mark symbols static where possible

2016-09-30 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/radeon/si.c:7850:5: warning: no previous prototype for 
'si_vce_send_vcepll_ctlreq' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:226:21: warning: no previous prototype 
for 'radeon_mst_best_encoder' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:344:26: warning: no previous prototype 
for 'radeon_mst_find_connector' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:600:6: warning: no previous prototype 
for 'radeon_dp_mst_encoder_destroy' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/radeon_dp_mst.c | 8 +---
 drivers/gpu/drm/radeon/si.c| 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c 
b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index de504ea..6d1237d 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -223,7 +223,8 @@ radeon_dp_mst_mode_valid(struct drm_connector *connector,
return MODE_OK;
 }

-struct drm_encoder *radeon_mst_best_encoder(struct drm_connector *connector)
+static struct
+drm_encoder *radeon_mst_best_encoder(struct drm_connector *connector)
 {
struct radeon_connector *radeon_connector = 
to_radeon_connector(connector);

@@ -341,7 +342,8 @@ const struct drm_dp_mst_topology_cbs mst_cbs = {
.hotplug = radeon_dp_mst_hotplug,
 };

-struct radeon_connector *radeon_mst_find_connector(struct drm_encoder *encoder)
+static struct
+radeon_connector *radeon_mst_find_connector(struct drm_encoder *encoder)
 {
struct drm_device *dev = encoder->dev;
struct drm_connector *connector;
@@ -597,7 +599,7 @@ static const struct drm_encoder_helper_funcs 
radeon_mst_helper_funcs = {
.commit = radeon_mst_encoder_commit,
 };

-void radeon_dp_mst_encoder_destroy(struct drm_encoder *encoder)
+static void radeon_dp_mst_encoder_destroy(struct drm_encoder *encoder)
 {
drm_encoder_cleanup(encoder);
kfree(encoder);
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index e5ceeb4..f73e441 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -7847,7 +7847,7 @@ static void si_program_aspm(struct radeon_device *rdev)
}
 }

-int si_vce_send_vcepll_ctlreq(struct radeon_device *rdev)
+static int si_vce_send_vcepll_ctlreq(struct radeon_device *rdev)
 {
unsigned i;

-- 
2.7.4



[PATCH 3/3] drm/radeon: mark symbols static where possible

2016-09-30 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/radeon/si.c:7850:5: warning: no previous prototype for 
'si_vce_send_vcepll_ctlreq' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:226:21: warning: no previous prototype 
for 'radeon_mst_best_encoder' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:344:26: warning: no previous prototype 
for 'radeon_mst_find_connector' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:600:6: warning: no previous prototype 
for 'radeon_dp_mst_encoder_destroy' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/radeon_dp_mst.c | 8 +---
 drivers/gpu/drm/radeon/si.c| 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c 
b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index de504ea..6d1237d 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -223,7 +223,8 @@ radeon_dp_mst_mode_valid(struct drm_connector *connector,
return MODE_OK;
 }

-struct drm_encoder *radeon_mst_best_encoder(struct drm_connector *connector)
+static struct
+drm_encoder *radeon_mst_best_encoder(struct drm_connector *connector)
 {
struct radeon_connector *radeon_connector = 
to_radeon_connector(connector);

@@ -341,7 +342,8 @@ const struct drm_dp_mst_topology_cbs mst_cbs = {
.hotplug = radeon_dp_mst_hotplug,
 };

-struct radeon_connector *radeon_mst_find_connector(struct drm_encoder *encoder)
+static struct
+radeon_connector *radeon_mst_find_connector(struct drm_encoder *encoder)
 {
struct drm_device *dev = encoder->dev;
struct drm_connector *connector;
@@ -597,7 +599,7 @@ static const struct drm_encoder_helper_funcs 
radeon_mst_helper_funcs = {
.commit = radeon_mst_encoder_commit,
 };

-void radeon_dp_mst_encoder_destroy(struct drm_encoder *encoder)
+static void radeon_dp_mst_encoder_destroy(struct drm_encoder *encoder)
 {
drm_encoder_cleanup(encoder);
kfree(encoder);
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index e5ceeb4..f73e441 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -7847,7 +7847,7 @@ static void si_program_aspm(struct radeon_device *rdev)
}
 }

-int si_vce_send_vcepll_ctlreq(struct radeon_device *rdev)
+static int si_vce_send_vcepll_ctlreq(struct radeon_device *rdev)
 {
unsigned i;

-- 
2.7.4



[PATCH 1/3] drm/radeon: add missing header dependencies

2016-09-30 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/radeon/radeon_clocks.c:35:10: warning: no previous prototype 
for 'radeon_legacy_get_engine_clock' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/atombios_encoders.c:75:1: warning: no previous prototype 
for 'atombios_get_backlight_level' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/r600_cs.c:2268:5: warning: no previous prototype for 
'r600_cs_parse' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/evergreen_cs.c:2671:5: warning: no previous prototype 
for 'evergreen_cs_parse' [-Wmissing-prototypes]


In fact, these functions are declared
in drivers/gpu/drm/radeon/radeon_asic.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/atombios_encoders.c  | 1 +
 drivers/gpu/drm/radeon/evergreen_cs.c   | 1 +
 drivers/gpu/drm/radeon/r600_cs.c| 1 +
 drivers/gpu/drm/radeon/radeon_atombios.c| 1 +
 drivers/gpu/drm/radeon/radeon_clocks.c  | 1 +
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 +
 6 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index 56bb758..fa4f8f0 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -28,6 +28,7 @@
 #include 
 #include "radeon.h"
 #include "radeon_audio.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include 

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
b/drivers/gpu/drm/radeon/evergreen_cs.c
index d960d39..f8b0509 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -27,6 +27,7 @@
  */
 #include 
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "evergreend.h"
 #include "evergreen_reg_safe.h"
 #include "cayman_reg_safe.h"
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index b69c8de..595a197 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "r600d.h"
 #include "r600_reg_safe.h"

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5df3ec7..4134759 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -29,6 +29,7 @@

 #include "atom.h"
 #include "atom-bits.h"
+#include "radeon_asic.h"

 extern void
 radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c 
b/drivers/gpu/drm/radeon/radeon_clocks.c
index 38e396d..c1135fe 100644
--- a/drivers/gpu/drm/radeon/radeon_clocks.c
+++ b/drivers/gpu/drm/radeon/radeon_clocks.c
@@ -29,6 +29,7 @@
 #include 
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"

 /* 10 khz */
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 868c3ba..222a1fa 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include 
 #ifdef CONFIG_PMAC_BACKLIGHT
-- 
2.7.4



[PATCH 4/4] drm/amdgpu: remove unused functions

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:146:5: warning: no previous 
prototype for 'pool_to_domain' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:104:5: warning: no previous prototype for 
'cz_send_msg_to_smc_with_parameter_async' [-Wmissing-prototypes]

In fact, both functions are called by no one and not exported,
so this patch removes them.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 
 drivers/gpu/drm/amd/amdgpu/cz_smc.c| 7 ---
 2 files changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index d080d08..dba8a5b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -143,14 +143,6 @@ int amdgpu_amdkfd_resume(struct amdgpu_device *rdev)
return r;
 }

-u32 pool_to_domain(enum kgd_memory_pool p)
-{
-   switch (p) {
-   case KGD_POOL_FRAMEBUFFER: return AMDGPU_GEM_DOMAIN_VRAM;
-   default: return AMDGPU_GEM_DOMAIN_GTT;
-   }
-}
-
 int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
void **mem_obj, uint64_t *gpu_addr,
void **cpu_ptr)
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c 
b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
index 95887e4..aed7033 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
@@ -101,13 +101,6 @@ int cz_send_msg_to_smc(struct amdgpu_device *adev, u16 msg)
return 0;
 }

-int cz_send_msg_to_smc_with_parameter_async(struct amdgpu_device *adev,
-   u16 msg, u32 parameter)
-{
-   WREG32(mmSMU_MP1_SRBM2P_ARG_0, parameter);
-   return cz_send_msg_to_smc_async(adev, msg);
-}
-
 int cz_send_msg_to_smc_with_parameter(struct amdgpu_device *adev,
u16 msg, u32 parameter)
 {
-- 
2.7.4



[PATCH 3/4] drm/amdgpu: add amdgpu_pm_acpi_event_handler() declaration

2016-09-25 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:37:6: warning: no previous prototype for 
'amdgpu_pm_acpi_event_handler' [-Wmissing-prototypes]

In fact, it need to declare it in a header files.

So this patch adds the declaration in
drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h  | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 6a75a48..e88a9ac 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1645,6 +1645,7 @@ struct amdgpu_pm {
 };

 void amdgpu_get_pcie_info(struct amdgpu_device *adev);
+void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);

 /*
  * UVD
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 5cd7b73..eaaba0d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -32,7 +32,6 @@
 #include "amd_acpi.h"
 #include "atom.h"

-extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
 /* Call the ATIF method
  */
 /**
-- 
2.7.4


[PATCH 2/4] drm/amdgpu: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:2046:5: warning: no previous 
prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/si.c:908:5: warning: no previous prototype for 
'si_pciep_rreg' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype 
for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
 drivers/gpu/drm/amd/amdgpu/si.c| 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 319a5e1..decbba5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1545,7 +1545,8 @@ static int amdgpu_connector_virtual_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }

-int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
+static int
+amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
 {
return 0;
 }
@@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector 
*connector, bool force)
return connector_status_connected;
 }

-int amdgpu_connector_virtual_set_property(struct drm_connector *connector,
+static int
+amdgpu_connector_virtual_set_property(struct drm_connector *connector,
  struct drm_property *property,
  uint64_t val)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3ddae5f..5b4a63f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2043,7 +2043,7 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device 
*adev)
return asic_hang;
 }

-int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
+static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
 {
int i, r = 0;

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c 
b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 619b604..30badd2 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct amdgpu_device 
*adev)
return false;
 }

-void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
  struct amdgpu_mode_mc_save *save)
 {
switch (adev->asic_type) {
@@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device 
*adev,

return;
 }
-void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
struct amdgpu_mode_mc_save *save)
 {
return;
 }

-void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
+static void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
bool render)
 {
return;
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index fee76b8..e768683 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -905,7 +905,7 @@ static void si_pcie_wreg(struct amdgpu_device *adev, u32 
reg, u32 v)
spin_unlock_irqrestore(>pcie_idx_lock, flags);
 }

-u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
+static u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
 {
unsigned long flags;
u32 r;
@@ -918,7 +918,7 @@ u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
return r;
 }

-void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
+static void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
 {
unsigned long flags;

-- 
2.7.4



[PATCH 1/4] drm/amdgpu: add missing header dependencies

2016-09-25 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c:629:6: warning: no previous prototype for 
'dce_v8_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c:730:6: warning: no previous prototype 
for 'dce_v10_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c:699:6: warning: no previous prototype 
for 'dce_v11_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:40:5: warning: no previous prototype 
for 'amdgpu_gfx_scratch_get' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:62:6: warning: no previous prototype 
for 'amdgpu_gfx_scratch_free' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:84:6: warning: no previous prototype 
for 'amdgpu_gfx_parse_disable_cu' [-Wmissing-prototypes]


In fact, these functions are declared in
drivers/gpu/drm/amd/amdgpu/atombios_crtc.h,
drivers/gpu/drm/amd/amdgpu/dce_v8_0.h
drivers/gpu/drm/amd/amdgpu/dce_v10_0.h
drivers/gpu/drm/amd/amdgpu/dce_v11_0.h
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h,
so this patch adds missing header dependencies.

by the way, we amend the declaration of amdgpu_gfx_parse_disable_cu().

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c| 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h| 3 ++-
 drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c  | 1 +
 6 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index a074edd..01a42b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -24,6 +24,7 @@
  */
 #include 
 #include "amdgpu.h"
+#include "amdgpu_gfx.h"

 /*
  * GPU scratch registers helpers function.
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 51321e1..abd9432 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -27,6 +27,7 @@
 int amdgpu_gfx_scratch_get(struct amdgpu_device *adev, uint32_t *reg);
 void amdgpu_gfx_scratch_free(struct amdgpu_device *adev, uint32_t reg);

-unsigned amdgpu_gfx_parse_disable_cu(unsigned *mask, unsigned max_se, unsigned 
max_sh);
+void amdgpu_gfx_parse_disable_cu(unsigned int *mask, unsigned int max_se,
+   unsigned int max_sh);

 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c 
b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c
index f7d236f..4853ae0 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c
@@ -30,6 +30,7 @@
 #include "amdgpu.h"
 #include "atom.h"
 #include "atom-bits.h"
+#include "atombios_crtc.h"
 #include "atombios_encoders.h"
 #include "amdgpu_atombios.h"
 #include "amdgpu_pll.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index bc5bb4e..d3925a5 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -32,6 +32,7 @@
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"

+#include "dce_v10_0.h"
 #include "dce/dce_10_0_d.h"
 #include "dce/dce_10_0_sh_mask.h"
 #include "dce/dce_10_0_enum.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index b93eba0..1002113 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -32,6 +32,7 @@
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"

+#include "dce_v11_0.h"
 #include "dce/dce_11_0_d.h"
 #include "dce/dce_11_0_sh_mask.h"
 #include "dce/dce_11_0_enum.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index abd5213..686c50d 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -32,6 +32,7 @@
 #include "amdgpu_pll.h"
 #include "amdgpu_connectors.h"

+#include "dce_v8_0.h"
 #include "dce/dce_8_0_d.h"
 #include "dce/dce_8_0_sh_mask.h"

-- 
2.7.4



[PATCH 4/4] drm/amd/powerplay: remove unused functions

2016-09-25 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:65:6: 
warning: no previous prototype for 'cz_phm_is_safe_for_asic_block' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:2856:5: warning: no 
previous prototype for 'tonga_populate_smc_initial_state' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/polaris10_hwmgr.c:2684:5: 
warning: no previous prototype for 'polaris10_disable_dpm_tasks' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/iceland_hwmgr.c:1154:9: warning: 
no previous prototype for 'iceland_get_voltage_index' [-Wmissing-prototypes]


In fact, these functions are called by no one and not exported,
so this patch removes them.

Signed-off-by: Baoyou Xie 
---
 .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c  |  42 -
 .../gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c|  49 -
 .../gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c  | 207 -
 .../drm/amd/powerplay/hwmgr/polaris10_powertune.c  |  78 
 .../drm/amd/powerplay/hwmgr/polaris10_powertune.h  |   2 -
 .../amd/powerplay/hwmgr/tonga_clockpowergating.c   |   8 -
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c  |  78 
 .../drm/amd/powerplay/smumgr/polaris10_smumgr.c|  94 --
 8 files changed, 558 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
index 2028980..0966fc8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
@@ -61,48 +61,6 @@ int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, 
enum PHM_AsicBlock bloc
return ret;
 }

-
-bool cz_phm_is_safe_for_asic_block(struct pp_hwmgr *hwmgr, const struct 
pp_hw_power_state *state, enum PHM_AsicBlock block)
-{
-   return true;
-}
-
-
-int cz_phm_enable_disable_gfx_power_gating(struct pp_hwmgr *hwmgr, bool enable)
-{
-   return 0;
-}
-
-int cz_phm_smu_power_up_down_pcie(struct pp_hwmgr *hwmgr, uint32_t target, 
bool up, uint32_t args)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_initialize_display_phy_access(struct pp_hwmgr *hwmgr, bool 
initialize, bool accesshw)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_get_display_phy_access_info(struct pp_hwmgr *hwmgr)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_gate_unused_display_phys(struct pp_hwmgr *hwmgr)
-{
-   /* TODO */
-   return 0;
-}
-
-int cz_phm_ungate_all_display_phys(struct pp_hwmgr *hwmgr)
-{
-   /* TODO */
-   return 0;
-}
-
 static int cz_tf_uvd_power_gating_initialize(struct pp_hwmgr *hwmgr, void 
*pInput, void *pOutput, void *pStorage, int Result)
 {
return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
index 364c846..96b8a82 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
@@ -1143,34 +1143,6 @@ static int iceland_setup_default_dpm_tables(struct 
pp_hwmgr *hwmgr)
return 0;
 }

-/**
- * @brief PhwIceland_GetVoltageOrder
- *  Returns index of requested voltage record in lookup(table)
- * @param hwmgr - pointer to hardware manager
- * @param lookutab - lookup list to search in
- * @param voltage - voltage to look for
- * @return 0 on success
- */
-uint8_t iceland_get_voltage_index(phm_ppt_v1_voltage_lookup_table 
*look_up_table,
-   uint16_t voltage)
-{
-   uint8_t count = (uint8_t) (look_up_table->count);
-   uint8_t i;
-
-   PP_ASSERT_WITH_CODE((NULL != look_up_table), "Lookup Table empty.", 
return 0;);
-   PP_ASSERT_WITH_CODE((0 != count), "Lookup Table empty.", return 0;);
-
-   for (i = 0; i < count; i++) {
-   /* find first voltage equal or bigger than requested */
-   if (look_up_table->entries[i].us_vdd >= voltage)
-   return i;
-   }
-
-   /* voltage is bigger than max voltage in the table */
-   return i-1;
-}
-
-
 static int iceland_get_std_voltage_value_sidd(struct pp_hwmgr *hwmgr,
pp_atomctrl_voltage_table_entry *tab, uint16_t *hi,
uint16_t *lo)
@@ -1558,27 +1530,6 @@ static int iceland_populate_smc_uvd_level(struct 
pp_hwmgr *hwmgr,
return 0;
 }

-uint8_t iceland_get_voltage_id(pp_atomctrl_voltage_table *voltage_table,
-   uint32_t voltage)
-{
-   uint8_t count = (uint8_t) (voltage_table->count);
-   uint8_t i = 0;
-
-   PP_ASSERT_WITH_CODE((NULL != voltage_table),
-   "Voltage Table empty.", return 0;);
-   PP_ASSERT_WITH_CODE((0 != count),
-   "Voltage Table empty.", return 0;);
-
-   for (i = 0; i < count; i++) {
-   /* find first voltage bigger than reques

[PATCH 3/4] drm/amd/powerplay: add function declarations

2016-09-25 Thread Baoyou Xie
We get 6 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:177:5: warning: no 
previous prototype for 'tonga_notify_smc_display_change' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:3238:5: warning: no 
previous prototype for 'tonga_get_mc_microcode_version' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:3252:5: warning: no 
previous prototype for 
'tonga_initializa_dynamic_state_adjustment_rule_settings' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:5855:5: warning: no 
previous prototype for 'tonga_notify_smc_display_config_after_ps_adjustment' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/fiji_hwmgr.c:5594:5: warning: no 
previous prototype for 'fiji_hwmgr_init' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/eventmgr/eventtasks.c:322:5: warning: 
no previous prototype for 'pem_task_enable_clock_power_gating' 
[-Wmissing-prototypes]

In fact, these functions are undeclared in any files.

So this patch declares them in
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.h,
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.h,
drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h | 2 ++
 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.h| 1 +
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.h   | 6 ++
 3 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h 
b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h
index 6c6297e..7e6fb48 100644
--- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h
+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h
@@ -58,6 +58,8 @@ int pem_task_un_block_hw_access(struct pp_eventmgr *eventmgr, 
struct pem_event_d
 int pem_task_reset_display_phys_access(struct pp_eventmgr *eventmgr, struct 
pem_event_data *event_data);
 int pem_task_set_cpu_power_state(struct pp_eventmgr *eventmgr, struct 
pem_event_data *event_data);
 int pem_task_notify_smc_display_config_after_power_state_adjustment(struct 
pp_eventmgr *eventmgr, struct pem_event_data *event_data);
+int pem_task_enable_clock_power_gating(struct pp_eventmgr *eventmgr,
+   struct pem_event_data *event_data);
 /*powersaving*/

 int pem_task_set_power_source(struct pp_eventmgr *eventmgr, struct 
pem_event_data *event_data);
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.h 
b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.h
index bf67c2a..c37f9e8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.h
@@ -346,5 +346,6 @@ int fiji_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate);
 int fiji_update_samu_dpm(struct pp_hwmgr *hwmgr, bool bgate);
 int fiji_update_acp_dpm(struct pp_hwmgr *hwmgr, bool bgate);
 int fiji_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable);
+int fiji_hwmgr_init(struct pp_hwmgr *hwmgr);

 #endif /* _FIJI_HWMGR_H_ */
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.h 
b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.h
index 3a91fc2..be5e10a 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.h
@@ -398,4 +398,10 @@ int tonga_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, 
bool enable);
 int tonga_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable);
 uint32_t tonga_get_xclk(struct pp_hwmgr *hwmgr);

+int
+tonga_initializa_dynamic_state_adjustment_rule_settings(struct pp_hwmgr 
*hwmgr);
+int tonga_get_mc_microcode_version(struct pp_hwmgr *hwmgr);
+int tonga_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr 
*hwmgr);
+int tonga_notify_smc_display_change(struct pp_hwmgr *hwmgr, bool has_display);
+
 #endif
-- 
2.7.4



[PATCH 2/4] drm/amd/powerplay: add missing header dependencies

2016-09-25 Thread Baoyou Xie
We get 3 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/pp_acpi.c:29:6: warning: no 
previous prototype for 'acpi_atcs_functions_supported' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/pp_acpi.c:47:6: warning: no 
previous prototype for 'acpi_atcs_notify_pcie_device_ready' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/pp_acpi.c:61:5: warning: no 
previous prototype for 'acpi_pcie_perf_request' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c | 1 +
 1 files changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
index 1944d28..f5e8fda 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
@@ -25,6 +25,7 @@
 #include "linux/delay.h"
 #include "hwmgr.h"
 #include "amd_acpi.h"
+#include "pp_acpi.h"

 bool acpi_atcs_functions_supported(void *device, uint32_t index)
 {
-- 
2.7.4



[PATCH 1/4] drm/amd/powerplay: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_hwmgr.c:69:10: warning: no 
previous prototype for 'cz_get_eclk_level' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:117:27: warning: no 
previous prototype for 'cast_phw_tonga_power_state' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_thermal.c:363:5: warning: 
no previous prototype for 'tf_tonga_thermal_setup_fan_table' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/iceland_hwmgr.c:139:5: warning: 
no previous prototype for 'iceland_get_memory_type' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/iceland_thermal.c:363:5: warning: 
no previous prototype for 'tf_iceland_thermal_setup_fan_table' 
[-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c  |   6 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c |  12 +-
 .../gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c|  86 +++--
 .../gpu/drm/amd/powerplay/hwmgr/iceland_thermal.c  |  10 +-
 .../amd/powerplay/hwmgr/process_pptables_v1_0.c|   6 +-
 .../gpu/drm/amd/powerplay/hwmgr/processpptables.c  |   4 +-
 .../amd/powerplay/hwmgr/tonga_clockpowergating.c   |   4 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c  | 140 +++--
 .../gpu/drm/amd/powerplay/hwmgr/tonga_thermal.c|   9 +-
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c |  22 ++--
 .../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c  |   2 +-
 .../drm/amd/powerplay/smumgr/polaris10_smumgr.c|  22 ++--
 .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c|   2 +-
 13 files changed, 179 insertions(+), 146 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c 
b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index b1d1940..83a355c 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -507,7 +507,9 @@ static enum PP_StateUILabel power_state_convert(enum 
amd_pm_state_type  state)
}
 }

-int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event event_id, void 
*input, void *output)
+static int
+pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event event_id,
+   void *input, void *output)
 {
int ret = 0;
struct pp_instance *pp_handle;
@@ -546,7 +548,7 @@ int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_event 
event_id, void *input,
return ret;
 }

-enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
+static enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
 {
struct pp_hwmgr *hwmgr;
struct pp_power_state *state;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index 5ecef17..41dfc34 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -66,7 +66,7 @@ static const struct cz_power_state 
*cast_const_PhwCzPowerState(
return (struct cz_power_state *)hw_ps;
 }

-uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
+static uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
uint32_t clock, uint32_t msg)
 {
int i = 0;
@@ -1017,7 +1017,7 @@ static int cz_tf_program_bootup_state(struct pp_hwmgr 
*hwmgr, void *input,
return 0;
 }

-int cz_tf_reset_acp_boot_level(struct pp_hwmgr *hwmgr, void *input,
+static int cz_tf_reset_acp_boot_level(struct pp_hwmgr *hwmgr, void *input,
void *output, void *storage, int result)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
@@ -1225,7 +1225,7 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1239,7 +1239,7 @@ int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
+static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
struct phm_clock_voltage_dependency_table *table =
@@ -1277,7 +1277,7 @@ int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1533,7 +1533,7 @@ static int cz_dpm_get_pp_table_entry(struct pp_hwmgr 
*hwmgr,
return result;
 }

-int cz_get_power_state

[PATCH] drm/i2c: mark tda998x_audio_digital_mute() static

2016-09-25 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/i2c/tda998x_drv.c:1292:5: warning: no previous prototype for 
'tda998x_audio_digital_mute' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 9798d40..8bf6611 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1289,7 +1289,7 @@ static void tda998x_audio_shutdown(struct device *dev, 
void *data)
mutex_unlock(>audio_mutex);
 }

-int tda998x_audio_digital_mute(struct device *dev, void *data, bool enable)
+static int tda998x_audio_digital_mute(struct device *dev, void *data, bool 
enable)
 {
struct tda998x_priv *priv = dev_get_drvdata(dev);

-- 
2.7.4



[PATCH] drm/sti: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 6 warnings when building kernel with W=1:
drivers/gpu/drm/sti/sti_mixer.c:361:6: warning: no previous prototype for 
'sti_mixer_set_matrix' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_dvo.c:109:5: warning: no previous prototype for 
'dvo_awg_generate_code' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_gdp.c:476:5: warning: no previous prototype for 
'sti_gdp_field_cb' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_hqvdp.c:786:5: warning: no previous prototype for 
'sti_hqvdp_vtg_cb' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_hqvdp.c:1292:5: warning: no previous prototype for 
'sti_hqvdp_bind' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_drv.c:143:6: warning: no previous prototype for 
'sti_drm_dbg_cleanup' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/sti/sti_drv.c   | 2 +-
 drivers/gpu/drm/sti/sti_dvo.c   | 3 ++-
 drivers/gpu/drm/sti/sti_gdp.c   | 2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c | 5 +++--
 drivers/gpu/drm/sti/sti_mixer.c | 2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 7cd3804..e6f0706 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -140,7 +140,7 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
return ret;
 }

-void sti_drm_dbg_cleanup(struct drm_minor *minor)
+static void sti_drm_dbg_cleanup(struct drm_minor *minor)
 {
drm_debugfs_remove_files(sti_drm_dbg_list,
 ARRAY_SIZE(sti_drm_dbg_list), minor);
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 00881eb..4545ad0 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -106,7 +106,8 @@ struct sti_dvo_connector {
container_of(x, struct sti_dvo_connector, drm_connector)

 #define BLANKING_LEVEL 16
-int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
+static int
+dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
 {
struct drm_display_mode *mode = >mode;
struct dvo_config *config = dvo->config;
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index b8d942c..4648d1b 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -473,7 +473,7 @@ static void sti_gdp_disable(struct sti_gdp *gdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_gdp_field_cb(struct notifier_block *nb,
+static int sti_gdp_field_cb(struct notifier_block *nb,
unsigned long event, void *data)
 {
struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb);
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index b5ee783..7f0dea8 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -783,7 +783,8 @@ static void sti_hqvdp_disable(struct sti_hqvdp *hqvdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
+static int
+sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
 {
struct sti_hqvdp *hqvdp = container_of(nb, struct sti_hqvdp, vtg_nb);
int btm_cmd_offset, top_cmd_offest;
@@ -1289,7 +1290,7 @@ static struct drm_plane *sti_hqvdp_create(struct 
drm_device *drm_dev,
return >plane.drm_plane;
 }

-int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
+static int sti_hqvdp_bind(struct device *dev, struct device *master, void 
*data)
 {
struct sti_hqvdp *hqvdp = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index 7d9aea8..b78cec5 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -358,7 +358,7 @@ int sti_mixer_set_plane_status(struct sti_mixer *mixer,
return 0;
 }

-void sti_mixer_set_matrix(struct sti_mixer *mixer)
+static void sti_mixer_set_matrix(struct sti_mixer *mixer)
 {
unsigned int i;

-- 
2.7.4



[PATCH] drm/exynos: mark exynos_dp_crtc_clock_enable() static

2016-09-25 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/exynos/exynos_dp.c:46:5: warning: no previous prototype for 
'exynos_dp_crtc_clock_enable' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/exynos/exynos_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_dp.c 
b/drivers/gpu/drm/exynos/exynos_dp.c
index 4f08505..528229f 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -43,7 +43,7 @@ struct exynos_dp_device {
struct analogix_dp_plat_data plat_data;
 };

-int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
+static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
bool enable)
 {
struct exynos_dp_device *dp = to_dp(plat_data);
-- 
2.7.4



[PATCH 2/2] drm/msm/adreno: move function declarations to header file

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/adreno/a3xx_gpu.c:535:17: warning: no previous prototype 
for 'a3xx_gpu_init' [-Wmissing-prototypes]
drivers/gpu/drm/msm/adreno/a4xx_gpu.c:624:17: warning: no previous prototype 
for 'a4xx_gpu_init' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/msm/adreno/adreno_device.c, but should be declared in
a header file. So this patch moves both function declarations to
drivers/gpu/drm/msm/adreno/adreno_gpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/msm/adreno/adreno_device.c | 3 ---
 drivers/gpu/drm/msm/adreno/adreno_gpu.h| 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 5127b75..7250ffc 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -25,9 +25,6 @@ bool hang_debug = false;
 MODULE_PARM_DESC(hang_debug, "Dump registers when hang is detected (can be 
slow!)");
 module_param_named(hang_debug, hang_debug, bool, 0600);

-struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
-struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
-
 static const struct adreno_info gpulist[] = {
{
.rev   = ADRENO_REV(3, 0, 5, ANY_ID),
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index a54f6e0..07d99bd 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -311,4 +311,7 @@ static inline void adreno_gpu_write(struct adreno_gpu *gpu,
gpu_write(>base, reg - 1, data);
 }

+struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
+struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
+
 #endif /* __ADRENO_GPU_H__ */
-- 
2.7.4



[PATCH 1/2] drm/msm: add missing header dependencies

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/msm_debugfs.c:141:5: warning: no previous prototype for 
'msm_debugfs_init' [-Wmissing-prototypes]
drivers/gpu/drm/msm/msm_debugfs.c:158:6: warning: no previous prototype for 
'msm_debugfs_cleanup' [-Wmissing-prototypes]

In fact, both functions are declared in drivers/gpu/drm/msm/msm_debugfs.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/msm/msm_debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/msm_debugfs.c 
b/drivers/gpu/drm/msm/msm_debugfs.c
index 663f2b6..3c85373 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -18,6 +18,7 @@
 #ifdef CONFIG_DEBUG_FS
 #include "msm_drv.h"
 #include "msm_gpu.h"
+#include "msm_debugfs.h"

 static int msm_gpu_show(struct drm_device *dev, struct seq_file *m)
 {
-- 
2.7.4



[PATCH 2/2] drm/rockchip: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/rockchip/rockchip_drm_drv.c:309:6: warning: no previous 
prototype for 'rockchip_drm_fb_suspend' [-Wmissing-prototypes]
drivers/gpu/drm/rockchip/rockchip_drm_drv.c:318:6: warning: no previous 
prototype for 'rockchip_drm_fb_resume' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 76eaf1d..38c3be5 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -309,7 +309,7 @@ static struct drm_driver rockchip_drm_driver = {
 };

 #ifdef CONFIG_PM_SLEEP
-void rockchip_drm_fb_suspend(struct drm_device *drm)
+static void rockchip_drm_fb_suspend(struct drm_device *drm)
 {
struct rockchip_drm_private *priv = drm->dev_private;

@@ -318,7 +318,7 @@ void rockchip_drm_fb_suspend(struct drm_device *drm)
console_unlock();
 }

-void rockchip_drm_fb_resume(struct drm_device *drm)
+static void rockchip_drm_fb_resume(struct drm_device *drm)
 {
struct rockchip_drm_private *priv = drm->dev_private;

-- 
2.7.4



[PATCH] drm/mediatek: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/mediatek/mtk_hdmi.c:1089:6: warning: no previous prototype for 
'mtk_hdmi_audio_enable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1095:6: warning: no previous prototype for 
'mtk_hdmi_audio_disable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1101:5: warning: no previous prototype for 
'mtk_hdmi_audio_set_param' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1627:5: warning: no previous prototype for 
'mtk_hdmi_audio_digital_mute' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c 
b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 334562d..be4e19c 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1086,19 +1086,19 @@ static int mtk_hdmi_output_init(struct mtk_hdmi *hdmi)
return 0;
 }

-void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
+static void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
 {
mtk_hdmi_aud_enable_packet(hdmi, true);
hdmi->audio_enable = true;
 }

-void mtk_hdmi_audio_disable(struct mtk_hdmi *hdmi)
+static void mtk_hdmi_audio_disable(struct mtk_hdmi *hdmi)
 {
mtk_hdmi_aud_enable_packet(hdmi, false);
hdmi->audio_enable = false;
 }

-int mtk_hdmi_audio_set_param(struct mtk_hdmi *hdmi,
+static int mtk_hdmi_audio_set_param(struct mtk_hdmi *hdmi,
 struct hdmi_audio_param *param)
 {
if (!hdmi->audio_enable) {
@@ -1624,7 +1624,8 @@ static void mtk_hdmi_audio_shutdown(struct device *dev, 
void *data)
mtk_hdmi_audio_disable(hdmi);
 }

-int mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable)
+static int
+mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable)
 {
struct mtk_hdmi *hdmi = dev_get_drvdata(dev);

-- 
2.7.4



[PATCH] drm/mediatek: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/mediatek/mtk_hdmi.c:1089:6: warning: no previous prototype for 
'mtk_hdmi_audio_enable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1095:6: warning: no previous prototype for 
'mtk_hdmi_audio_disable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1101:5: warning: no previous prototype for 
'mtk_hdmi_audio_set_param' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1627:5: warning: no previous prototype for 
'mtk_hdmi_audio_digital_mute' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c 
b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 334562d..be4e19c 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1086,19 +1086,19 @@ static int mtk_hdmi_output_init(struct mtk_hdmi *hdmi)
return 0;
 }

-void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
+static void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
 {
mtk_hdmi_aud_enable_packet(hdmi, true);
hdmi->audio_enable = true;
 }

-void mtk_hdmi_audio_disable(struct mtk_hdmi *hdmi)
+static void mtk_hdmi_audio_disable(struct mtk_hdmi *hdmi)
 {
mtk_hdmi_aud_enable_packet(hdmi, false);
hdmi->audio_enable = false;
 }

-int mtk_hdmi_audio_set_param(struct mtk_hdmi *hdmi,
+static int mtk_hdmi_audio_set_param(struct mtk_hdmi *hdmi,
 struct hdmi_audio_param *param)
 {
if (!hdmi->audio_enable) {
@@ -1624,7 +1624,8 @@ static void mtk_hdmi_audio_shutdown(struct device *dev, 
void *data)
mtk_hdmi_audio_disable(hdmi);
 }

-int mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable)
+static int
+mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable)
 {
struct mtk_hdmi *hdmi = dev_get_drvdata(dev);

-- 
2.7.4



[PATCH 1/2] drm/rockchip: add missing header dependencies

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c:130:5: warning: no previous 
prototype for 'rockchip_drm_fbdev_init' [-Wmissing-prototypes]
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c:173:6: warning: no previous 
prototype for 'rockchip_drm_fbdev_fini' [-Wmissing-prototypes]

In fact, these functions are declared
in drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
index 207e01d..a16c69f 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
@@ -20,6 +20,7 @@
 #include "rockchip_drm_drv.h"
 #include "rockchip_drm_gem.h"
 #include "rockchip_drm_fb.h"
+#include "rockchip_drm_fbdev.h"

 #define PREFERRED_BPP  32
 #define to_drm_private(x) \
-- 
2.7.4



[PATCH] drm: bridge: analogix/dp: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1053:5: warning: no previous 
prototype for 'analogix_dp_get_modes' [-Wmissing-prototypes]
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1097:1: warning: no previous 
prototype for 'analogix_dp_detect' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 
b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index efac8ab..e6f7290 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1050,7 +1050,7 @@ out:
return ret;
 }

-int analogix_dp_get_modes(struct drm_connector *connector)
+static int analogix_dp_get_modes(struct drm_connector *connector)
 {
struct analogix_dp_device *dp = to_dp(connector);
struct edid *edid = (struct edid *)dp->edid;
@@ -1093,7 +1093,7 @@ static const struct drm_connector_helper_funcs 
analogix_dp_connector_helper_func
.best_encoder = analogix_dp_best_encoder,
 };

-enum drm_connector_status
+static enum drm_connector_status
 analogix_dp_detect(struct drm_connector *connector, bool force)
 {
struct analogix_dp_device *dp = to_dp(connector);
-- 
2.7.4



[PATCH] drm/bochs: mark bochs_connector_get_modes() static

2016-09-25 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/bochs/bochs_kms.c:181:5: warning: no previous prototype for 
'bochs_connector_get_modes' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/bochs/bochs_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bochs/bochs_kms.c 
b/drivers/gpu/drm/bochs/bochs_kms.c
index 207a2cb..0b4e5d1 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -178,7 +178,7 @@ static void bochs_encoder_init(struct drm_device *dev)
 }


-int bochs_connector_get_modes(struct drm_connector *connector)
+static int bochs_connector_get_modes(struct drm_connector *connector)
 {
int count;

-- 
2.7.4



[PATCH] drm: armada: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/armada/armada_gem.c:215:27: warning: no previous prototype for 
'armada_gem_alloc_object' [-Wmissing-prototypes]
drivers/gpu/drm/armada/armada_gem.c:423:1: warning: no previous prototype for 
'armada_gem_prime_map_dma_buf' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/armada/armada_gem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index cb8f034..1beef28 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -212,7 +212,8 @@ armada_gem_alloc_private_object(struct drm_device *dev, 
size_t size)
return obj;
 }

-struct armada_gem_object *armada_gem_alloc_object(struct drm_device *dev,
+static struct
+armada_gem_object *armada_gem_alloc_object(struct drm_device *dev,
size_t size)
 {
struct armada_gem_object *obj;
@@ -419,7 +420,7 @@ int armada_gem_pwrite_ioctl(struct drm_device *dev, void 
*data,
 }

 /* Prime support */
-struct sg_table *
+static struct sg_table *
 armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
enum dma_data_direction dir)
 {
-- 
2.7.4



[PATCH] drm: arm: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 
'malidp_duplicate_plane_state' [-Wmissing-prototypes]
drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 
'malidp_destroy_plane_state' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/arm/malidp_planes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c 
b/drivers/gpu/drm/arm/malidp_planes.c
index 725098d..5f8bece 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
devm_kfree(plane->dev->dev, mp);
 }

-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct
+drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
struct malidp_plane_state *state, *m_state;

@@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct 
drm_plane *plane)
return >base;
 }

-void malidp_destroy_plane_state(struct drm_plane *plane,
+static void malidp_destroy_plane_state(struct drm_plane *plane,
struct drm_plane_state *state)
 {
struct malidp_plane_state *m_state = to_malidp_plane_state(state);
-- 
2.7.4



[PATCH 2/2] drm/tilcdc: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous 
prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous 
prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous 
prototype for 'tilcdc_slave_compat_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_drv.c:64:5: warning: no previous prototype for 
'tilcdc_atomic_check' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c  | 2 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index f8892e9..562ee7f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -75,7 +75,7 @@ static void tilcdc_fb_output_poll_changed(struct drm_device 
*dev)
drm_fbdev_cma_hotplug_event(priv->fbdev);
 }

-int tilcdc_atomic_check(struct drm_device *dev,
+static int tilcdc_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state)
 {
int ret;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index f9c79da..dd8de260 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -139,7 +139,7 @@ static void __init tilcdc_node_disable(struct device_node 
*node)
of_update_property(node, prop);
 }

-struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
+static struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
 {
const int size = __dtb_tilcdc_slave_compat_end -
__dtb_tilcdc_slave_compat_begin;
@@ -195,7 +195,7 @@ static const char * const tilcdc_slave_props[] __initconst 
= {
NULL
 };

-void __init tilcdc_convert_slave_node(void)
+static void __init tilcdc_convert_slave_node(void)
 {
struct device_node *slave = NULL, *lcdc = NULL;
struct device_node *i2c = NULL, *fragment = NULL;
@@ -261,7 +261,7 @@ void __init tilcdc_convert_slave_node(void)
of_node_put(fragment);
 }

-int __init tilcdc_slave_compat_init(void)
+static int __init tilcdc_slave_compat_init(void)
 {
tilcdc_convert_slave_node();
return 0;
-- 
2.7.4



[PATCH 1/2] drm/tilcdc: add missing header dependencies

2016-09-25 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:397:12: warning: no previous prototype 
for 'tilcdc_tfp410_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:402:13: warning: no previous prototype 
for 'tilcdc_tfp410_fini' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:448:12: warning: no previous prototype 
for 'tilcdc_panel_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:453:13: warning: no previous prototype 
for 'tilcdc_panel_fini' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/tilcdc/tilcdc_tfp410.h,
drivers/gpu/drm/tilcdc/tilcdc_panel.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 1 +
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 7b36509..2134bb20 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -25,6 +25,7 @@
 #include 

 #include "tilcdc_drv.h"
+#include "tilcdc_panel.h"

 struct panel_module {
struct tilcdc_module base;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c 
b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index c6a70da..458043a 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -23,6 +23,7 @@
 #include 

 #include "tilcdc_drv.h"
+#include "tilcdc_tfp410.h"

 struct tfp410_module {
struct tilcdc_module base;
-- 
2.7.4



[PATCH 3/3] drm/nouveau: remove unused function

2016-09-25 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c:49:1: warning: no previous 
prototype for 'g94_sor_output_new' [-Wmissing-prototypes]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
index 1bb9d66..627b9ee1 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
@@ -39,21 +39,6 @@ g94_sor_loff(struct nvkm_output_dp *outp)
 }

 
/***
- * TMDS/LVDS
- 
**/
-static const struct nvkm_output_func
-g94_sor_output_func = {
-};
-
-int
-g94_sor_output_new(struct nvkm_disp *disp, int index,
-  struct dcb_output *dcbE, struct nvkm_output **poutp)
-{
-   return nvkm_output_new_(_sor_output_func, disp,
-   index, dcbE, poutp);
-}
-
-/***
  * DisplayPort
  
**/
 u32
-- 
2.7.4



[PATCH 2/3] drm/nouveau: mark symbols static where possible

2016-09-25 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:29:1: warning: no previous 
prototype for 'nvbios_fan_table' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c:184:1: warning: no previous 
prototype for 'gt215_clk_info' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:153:1: warning: no previous 
prototype for 'gt215_link_train' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c:51:1: warning: no previous 
prototype for 'gk104_volt_set' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nouveau_display.c   | 2 +-
 drivers/gpu/drm/nouveau/nv10_fence.c| 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/device/user.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 8 
 drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c  | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c   | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c  | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c  | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c   | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c  | 4 ++--
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c   | 8 
 drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c| 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c| 4 ++--
 17 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c 
b/drivers/gpu/drm/nouveau/nouveau_display.c
index afbf557..b60ee21 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -92,7 +92,7 @@ calc(int blanks, int blanke, int total, int line)
return line;
 }

-int
+static int
 nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime)
 {
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c 
b/drivers/gpu/drm/nouveau/nv10_fence.c
index 4e3de34..619f79d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.c
+++ b/drivers/gpu/drm/nouveau/nv10_fence.c
@@ -66,7 +66,7 @@ nv10_fence_context_del(struct nouveau_channel *chan)
nouveau_fence_context_free(>base);
 }

-int
+static int
 nv10_fence_context_new(struct nouveau_channel *chan)
 {
struct nv10_fence_chan *fctx;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
index 79a8f71..513ee6b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
@@ -326,7 +326,7 @@ nvkm_udevice = {
.sclass = nvkm_udevice_child_get,
 };

-int
+static int
 nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size,
 struct nvkm_object **pobject)
 {
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
index dd2953b..26990d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
@@ -153,7 +153,7 @@ nv50_disp_chan_uevent = {
.fini = nv50_disp_chan_uevent_fini,
 };

-int
+static int
 nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -163,7 +163,7 @@ nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, 
u32 *data)
return 0;
 }

-int
+static int
 nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, u32 data)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -173,7 +173,7 @@ nv50_disp_chan_wr32(struct nvkm_object *object, u64 addr, 
u32 data)
return 0;
 }

-int
+static int
 nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
struct nvkm_event **pevent)
 {
@@ -189,7 +189,7 @@ nv50_disp_chan_ntfy(struct nvkm_object *object, u32 type,
return -EINVAL;
 }

-int
+static int
 nv50_disp_chan_map(struct nvkm_object *object, u64 *addr, u32 *size)
 {
struct nv50_disp_chan *chan = nv50_disp_chan(object);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
index 2f9cecd..6424b39 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
@@ -66,7 +66,7 @@ nv50_disp_root_scanoutpos(NV50_DISP_MTHD_V0)
return 0;
 }

-int
+static int
 nv50_disp_root_mthd_(struct nvkm_object *object, u32 m

[PATCH 1/3] drm/nouveau: add missing header dependencies

2016-09-25 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c:60:1: warning: no previous 
prototype for 'nvkm_sddr2_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c:69:1: warning: no previous 
prototype for 'nvkm_sddr3_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c:35:1: warning: no previous 
prototype for 'nvkm_voltgpio_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c:54:1: warning: no previous 
prototype for 'nvkm_voltgpio_set' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c:71:1: warning: no previous 
prototype for 'nvkm_voltgpio_init' [-Wmissing-prototypes]


In fact, these functions are declared in
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h,
drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h,
drivers/gpu/drm/nouveau/nvkm/core/firmware.h,
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h,
drivers/gpu/drm/nouveau/dispnv04/disp.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/dispnv04/overlay.c   | 1 +
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 1 +
 drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c   | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c   | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c  | 1 +
 6 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c 
b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
index ec444ea..b756383 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
@@ -33,6 +33,7 @@
 #include "nouveau_connector.h"
 #include "nouveau_display.h"
 #include "nvreg.h"
+#include "disp.h"


 struct nouveau_plane {
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c 
b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index 34ecd4a..058ff46 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include 
+#include 

 /**
  * nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
index 1e13278..c8bb919 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c
@@ -106,6 +106,7 @@
 #define CP_SEEK_2  0x00c800ff

 #include "ctxnv40.h"
+#include "nv50.h"

 #include 

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
index b9f1ffd..4dcd874 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c
@@ -23,6 +23,7 @@
  *  Ben Skeggs
  */
 #include "priv.h"
+#include "ram.h"

 struct ramxlat {
int id;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
index 2690033..eca8a44 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c
@@ -23,6 +23,7 @@
  * Roy Spliet 
  */
 #include "priv.h"
+#include "ram.h"

 struct ramxlat {
int id;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
index d2bac1d..443c031 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include "priv.h"

 static const u8 tags[] = {
DCB_GPIO_VID0, DCB_GPIO_VID1, DCB_GPIO_VID2, DCB_GPIO_VID3,
-- 
2.7.4



[PATCH] dma-buf/sw_sync: mark sync_timeline_create() static

2016-09-24 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma-buf/sw_sync.c:87:23: warning: no previous prototype for 
'sync_timeline_create' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/dma-buf/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 62e8e6d..6f16c85 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -84,7 +84,7 @@ static inline struct sync_pt *fence_to_sync_pt(struct fence 
*fence)
  * Creates a new sync_timeline. Returns the sync_timeline object or NULL in
  * case of error.
  */
-struct sync_timeline *sync_timeline_create(const char *name)
+static struct sync_timeline *sync_timeline_create(const char *name)
 {
struct sync_timeline *obj;

-- 
2.7.4



[PATCH] drm/tilcdc: mark tilcdc_atomic_check() static

2016-09-21 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_drv.c:64:5: warning: no previous prototype for 
'tilcdc_atomic_check' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 4405e4b..1d26bc9 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -61,7 +61,7 @@ static void tilcdc_fb_output_poll_changed(struct drm_device 
*dev)
drm_fbdev_cma_hotplug_event(priv->fbdev);
 }

-int tilcdc_atomic_check(struct drm_device *dev,
+static int tilcdc_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state)
 {
int ret;
-- 
2.7.4



[PATCH] drm/tilcdc: add missing header dependencies

2016-09-21 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:397:12: warning: no previous prototype 
for 'tilcdc_tfp410_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:402:13: warning: no previous prototype 
for 'tilcdc_tfp410_fini' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:448:12: warning: no previous prototype 
for 'tilcdc_panel_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:453:13: warning: no previous prototype 
for 'tilcdc_panel_fini' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/tilcdc/tilcdc_tfp410.h,
drivers/gpu/drm/tilcdc/tilcdc_panel.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 1 +
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 4ac1d25..186cf23 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -25,6 +25,7 @@
 #include 

 #include "tilcdc_drv.h"
+#include "tilcdc_panel.h"

 struct panel_module {
struct tilcdc_module base;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c 
b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index 741c7b5..8692671 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -23,6 +23,7 @@
 #include 

 #include "tilcdc_drv.h"
+#include "tilcdc_tfp410.h"

 struct tfp410_module {
struct tilcdc_module base;
-- 
2.7.4



[PATCH] drm/amd/powerplay/hwmgr: mark symbols static where possible

2016-09-19 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_hwmgr.c:69:10: warning: no 
previous prototype for 'cz_get_eclk_level' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_hwmgr.c:117:27: warning: no 
previous prototype for 'cast_phw_tonga_power_state' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/tonga_thermal.c:363:5: warning: 
no previous prototype for 'tf_tonga_thermal_setup_fan_table' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/iceland_hwmgr.c:139:5: warning: 
no previous prototype for 'iceland_get_memory_type' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/iceland_thermal.c:363:5: warning: 
no previous prototype for 'tf_iceland_thermal_setup_fan_table' 
[-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c |   8 +-
 .../gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c|  92 +++--
 .../gpu/drm/amd/powerplay/hwmgr/iceland_thermal.c  |   9 +-
 .../amd/powerplay/hwmgr/tonga_clockpowergating.c   |   4 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c  | 148 +++--
 .../amd/powerplay/hwmgr/tonga_processpptables.c|   2 +-
 .../gpu/drm/amd/powerplay/hwmgr/tonga_thermal.c|   8 +-
 7 files changed, 147 insertions(+), 124 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index 5ecef17..5afb034 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -66,7 +66,7 @@ static const struct cz_power_state 
*cast_const_PhwCzPowerState(
return (struct cz_power_state *)hw_ps;
 }

-uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
+static uint32_t cz_get_eclk_level(struct pp_hwmgr *hwmgr,
uint32_t clock, uint32_t msg)
 {
int i = 0;
@@ -1225,7 +1225,7 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

@@ -1239,7 +1239,7 @@ int cz_phm_force_dpm_highest(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
+static int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);
struct phm_clock_voltage_dependency_table *table =
@@ -1277,7 +1277,7 @@ int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
return 0;
 }

-int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
+static int cz_phm_force_dpm_lowest(struct pp_hwmgr *hwmgr)
 {
struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend);

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
index 8a7ada5..547fb36 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c
@@ -136,7 +136,7 @@ static int iceland_read_clock_registers(struct pp_hwmgr 
*hwmgr)
  * @paramhwmgr  the address of the powerplay hardware manager.
  * @return   always 0
  */
-int iceland_get_memory_type(struct pp_hwmgr *hwmgr)
+static int iceland_get_memory_type(struct pp_hwmgr *hwmgr)
 {
iceland_hwmgr *data = (iceland_hwmgr *)(hwmgr->backend);
uint32_t temp;
@@ -162,7 +162,7 @@ int iceland_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool 
bgate)
  * @paramhwmgr  the address of the powerplay hardware manager.
  * @return   always 0
  */
-int iceland_enable_acpi_power_management(struct pp_hwmgr *hwmgr)
+static int iceland_enable_acpi_power_management(struct pp_hwmgr *hwmgr)
 {
PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, 
GENERAL_PWRMGT, STATIC_PM_EN, 1);

@@ -175,7 +175,7 @@ int iceland_enable_acpi_power_management(struct pp_hwmgr 
*hwmgr)
  * @paramhwmgr  the address of the powerplay hardware manager.
  * @return   always 0
  */
-int iceland_get_mc_microcode_version(struct pp_hwmgr *hwmgr)
+static int iceland_get_mc_microcode_version(struct pp_hwmgr *hwmgr)
 {
cgs_write_register(hwmgr->device, mmMC_SEQ_IO_DEBUG_INDEX, 0x9F);

@@ -262,7 +262,7 @@ static void iceland_trim_voltage_table_to_fit_state_table(
  * @paramhwmgr  the address of the powerplay hardware manager.
  * @return   always 0
  */
-int iceland_enable_voltage_control(struct pp_hwmgr *hwmgr)
+static int iceland_enable_voltage_control(struct pp_hwmgr *hwmgr)
 {
/* enable voltage control */
PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG_

[PATCH] drm/amd/powerplay/hwmgr: add missing header dependencies

2016-09-19 Thread Baoyou Xie
We get 3 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/pp_acpi.c:29:6: warning: no 
previous prototype for 'acpi_atcs_functions_supported' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/pp_acpi.c:47:6: warning: no 
previous prototype for 'acpi_atcs_notify_pcie_device_ready' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/pp_acpi.c:61:5: warning: no 
previous prototype for 'acpi_pcie_perf_request' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/amd/powerplay/inc/pp_acpi.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
index 1944d28..f5e8fda 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_acpi.c
@@ -25,6 +25,7 @@
 #include "linux/delay.h"
 #include "hwmgr.h"
 #include "amd_acpi.h"
+#include "pp_acpi.h"

 bool acpi_atcs_functions_supported(void *device, uint32_t index)
 {
-- 
2.7.4



[PATCH] drm/amd/powerplay/smumgr: mark symbols static where possible

2016-09-19 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:146:5: warning: 
no previous prototype for 'tonga_program_jump_on_start' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/fiji_smumgr.c:816:5: warning: no 
previous prototype for 'fiji_save_vft_table' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/polaris10_smumgr.c:743:5: 
warning: no previous prototype for 'polaris10_avfs_event_mgr' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/iceland_smumgr.c:167:5: warning: 
no previous prototype for 'iceland_program_jump_on_start' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 22 +++---
 .../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c  |  2 +-
 .../drm/amd/powerplay/smumgr/polaris10_smumgr.c| 20 +---
 .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c|  2 +-
 4 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c 
b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
index 8e52a2e..96fc38e 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
@@ -187,7 +187,7 @@ int fiji_copy_bytes_to_smc(struct pp_smumgr *smumgr,
return 0;
 }

-int fiji_program_jump_on_start(struct pp_smumgr *smumgr)
+static int fiji_program_jump_on_start(struct pp_smumgr *smumgr)
 {
static const unsigned char data[] = { 0xE0, 0x00, 0x80, 0x40 };

@@ -201,7 +201,7 @@ int fiji_program_jump_on_start(struct pp_smumgr *smumgr)
 *
 * @paramsmumgr  the address of the powerplay hardware manager.
 */
-bool fiji_is_smc_ram_running(struct pp_smumgr *smumgr)
+static bool fiji_is_smc_ram_running(struct pp_smumgr *smumgr)
 {
return ((0 == SMUM_READ_VFPF_INDIRECT_FIELD(smumgr->device,
CGS_IND_REG__SMC,
@@ -217,7 +217,7 @@ bool fiji_is_smc_ram_running(struct pp_smumgr *smumgr)
 * @parammsg the message to send.
 * @return   The response that came from the SMC.
 */
-int fiji_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg)
+static int fiji_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t msg)
 {
if (!fiji_is_smc_ram_running(smumgr))
return -1;
@@ -240,7 +240,7 @@ int fiji_send_msg_to_smc(struct pp_smumgr *smumgr, uint16_t 
msg)
  * @paramparameter: the parameter to send
  * @return   The response that came from the SMC.
  */
-int fiji_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr,
+static int fiji_send_msg_to_smc_with_parameter(struct pp_smumgr *smumgr,
uint16_t msg, uint32_t parameter)
 {
if (!fiji_is_smc_ram_running(smumgr))
@@ -267,7 +267,7 @@ int fiji_send_msg_to_smc_with_parameter(struct pp_smumgr 
*smumgr,
 * @paramparameter: the parameter to send
 * @return   The response that came from the SMC.
 */
-int fiji_send_msg_to_smc_with_parameter_without_waiting(
+static int fiji_send_msg_to_smc_with_parameter_without_waiting(
struct pp_smumgr *smumgr, uint16_t msg, uint32_t parameter)
 {
if (1 != SMUM_READ_FIELD(smumgr->device, SMC_RESP_0, SMC_RESP)) {
@@ -661,7 +661,7 @@ static int fiji_start_smu_in_non_protection_mode(struct 
pp_smumgr *smumgr)
return result;
 }

-int fiji_setup_pwr_virus(struct pp_smumgr *smumgr)
+static int fiji_setup_pwr_virus(struct pp_smumgr *smumgr)
 {
int i, result = -1;
uint32_t reg, data;
@@ -726,7 +726,7 @@ static int fiji_start_avfs_btc(struct pp_smumgr *smumgr)
return result;
 }

-int fiji_setup_pm_fuse_for_avfs(struct pp_smumgr *smumgr)
+static int fiji_setup_pm_fuse_for_avfs(struct pp_smumgr *smumgr)
 {
int result = 0;
uint32_t table_start;
@@ -762,7 +762,7 @@ int fiji_setup_pm_fuse_for_avfs(struct pp_smumgr *smumgr)
return result;
 }

-int fiji_setup_graphics_level_structure(struct pp_smumgr *smumgr)
+static int fiji_setup_graphics_level_structure(struct pp_smumgr *smumgr)
 {
int32_t vr_config;
uint32_t table_start;
@@ -801,7 +801,7 @@ int fiji_setup_graphics_level_structure(struct pp_smumgr 
*smumgr)
 }

 /* Work in Progress */
-int fiji_restore_vft_table(struct pp_smumgr *smumgr)
+static int fiji_restore_vft_table(struct pp_smumgr *smumgr)
 {
struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend);

@@ -813,7 +813,7 @@ int fiji_restore_vft_table(struct pp_smumgr *smumgr)
 }

 /* Work in Progress */
-int fiji_save_vft_table(struct pp_smumgr *smumgr)
+static int fiji_save_vft_table(struct pp_smumgr *smumgr)
 {
struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend);

@@ -824,7 +824,7 @@ int fiji_save_vft_table(stru

[PATCH] drm/amdgpu: add function declaration in amdgpu.h

2016-09-18 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:502:10: warning: no previous prototype 
for 'init_cond_exec' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:514:6: warning: no previous prototype 
for 'patch_cond_exec' [-Wmissing-prototypes]

In fact, both functions are not declared in any files.

So this patch declares them in drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 8e3d9b2..7b71cbe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -396,6 +396,8 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct 
fence **fence);
 void amdgpu_fence_process(struct amdgpu_ring *ring);
 int amdgpu_fence_wait_empty(struct amdgpu_ring *ring);
 unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring);
+unsigned int init_cond_exec(struct amdgpu_ring *ring);
+void patch_cond_exec(struct amdgpu_ring *ring, unsigned int offset);

 /*
  * BO.
-- 
2.7.4



[PATCH] drm/amdgpu: clean function declaration in amdgpu_pm.c up

2016-09-18 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:37:6: warning: no previous prototype for 
'amdgpu_pm_acpi_event_handler' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c, but should be
declared in a header file, thus can be recognized in other file.

So this patch moves the declaration into
drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h  | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 3208608..8e3d9b2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -2466,6 +2466,7 @@ struct amdgpu_afmt_acr {
 };

 struct amdgpu_afmt_acr amdgpu_afmt_acr(uint32_t clock);
+extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);

 /* amdgpu_acpi.c */
 #if defined(CONFIG_ACPI)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 5cd7b73..eaaba0d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -32,7 +32,6 @@
 #include "amd_acpi.h"
 #include "atom.h"

-extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev);
 /* Call the ATIF method
  */
 /**
-- 
2.7.4



[PATCH] drm/msm/adreno: move function declarations to header file

2016-09-18 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/adreno/a3xx_gpu.c:535:17: warning: no previous prototype 
for 'a3xx_gpu_init' [-Wmissing-prototypes]
drivers/gpu/drm/msm/adreno/a4xx_gpu.c:624:17: warning: no previous prototype 
for 'a4xx_gpu_init' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/msm/adreno/adreno_device.c, but should be declared in
a header file. So this patch moves both function declarations to
drivers/gpu/drm/msm/adreno/adreno_gpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/msm/adreno/adreno_device.c | 3 ---
 drivers/gpu/drm/msm/adreno/adreno_gpu.h| 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 5127b75..7250ffc 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -25,9 +25,6 @@ bool hang_debug = false;
 MODULE_PARM_DESC(hang_debug, "Dump registers when hang is detected (can be 
slow!)");
 module_param_named(hang_debug, hang_debug, bool, 0600);

-struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
-struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
-
 static const struct adreno_info gpulist[] = {
{
.rev   = ADRENO_REV(3, 0, 5, ANY_ID),
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index a54f6e0..07d99bd 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -311,4 +311,7 @@ static inline void adreno_gpu_write(struct adreno_gpu *gpu,
gpu_write(>base, reg - 1, data);
 }

+struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
+struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
+
 #endif /* __ADRENO_GPU_H__ */
-- 
2.7.4



[PATCH] drm/amdgpu: remove unused functions

2016-09-18 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:146:5: warning: no previous 
prototype for 'pool_to_domain' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:104:5: warning: no previous prototype for 
'cz_send_msg_to_smc_with_parameter_async' [-Wmissing-prototypes]

In fact, both functions are called by no one and not exported,
so this patch removes them.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 
 drivers/gpu/drm/amd/amdgpu/cz_smc.c| 7 ---
 2 files changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index d080d08..dba8a5b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -143,14 +143,6 @@ int amdgpu_amdkfd_resume(struct amdgpu_device *rdev)
return r;
 }

-u32 pool_to_domain(enum kgd_memory_pool p)
-{
-   switch (p) {
-   case KGD_POOL_FRAMEBUFFER: return AMDGPU_GEM_DOMAIN_VRAM;
-   default: return AMDGPU_GEM_DOMAIN_GTT;
-   }
-}
-
 int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
void **mem_obj, uint64_t *gpu_addr,
void **cpu_ptr)
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c 
b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
index 69ac373c4..db67e0c 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
@@ -101,13 +101,6 @@ int cz_send_msg_to_smc(struct amdgpu_device *adev, u16 msg)
return 0;
 }

-int cz_send_msg_to_smc_with_parameter_async(struct amdgpu_device *adev,
-   u16 msg, u32 parameter)
-{
-   WREG32(mmSMU_MP1_SRBM2P_ARG_0, parameter);
-   return cz_send_msg_to_smc_async(adev, msg);
-}
-
 int cz_send_msg_to_smc_with_parameter(struct amdgpu_device *adev,
u16 msg, u32 parameter)
 {
-- 
2.7.4



[PATCH] drm/amdgpu: mark symbols static where possible

2016-09-18 Thread Baoyou Xie
We get 7 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous 
prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_set_property' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous prototype 
for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous prototype 
for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype 
for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous prototype 
for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]

In fact, all of the functions are only used in the file
in which they are declared and don't need a declaration,
but can be made static.

So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 319a5e1..decbba5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1545,7 +1545,8 @@ static int amdgpu_connector_virtual_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }

-int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
+static int
+amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
 {
return 0;
 }
@@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector 
*connector, bool force)
return connector_status_connected;
 }

-int amdgpu_connector_virtual_set_property(struct drm_connector *connector,
+static int
+amdgpu_connector_virtual_set_property(struct drm_connector *connector,
  struct drm_property *property,
  uint64_t val)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index d80e5d3..b408eea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -327,7 +327,7 @@ retry:
return r;
 }

-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
 {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c38dc47..09b809d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device 
*adev)
return asic_hang;
 }

-int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
+static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
 {
int i, r = 0;

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c 
b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 00663a7..2d02acd 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct amdgpu_device 
*adev)
return false;
 }

-void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
  struct amdgpu_mode_mc_save *save)
 {
switch (adev->asic_type) {
@@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device 
*adev,

return;
 }
-void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
struct amdgpu_mode_mc_save *save)
 {
return;
 }

-void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
+static void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
bool render)
 {
return;
-- 
2.7.4



[PATCH] drm/mediatek: mark symbols static where possible

2016-09-18 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/mediatek/mtk_hdmi.c:1089:6: warning: no previous prototype for 
'mtk_hdmi_audio_enable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1095:6: warning: no previous prototype for 
'mtk_hdmi_audio_disable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1101:5: warning: no previous prototype for 
'mtk_hdmi_audio_set_param' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1627:5: warning: no previous prototype for 
'mtk_hdmi_audio_digital_mute' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c 
b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 334562d..be4e19c 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1086,19 +1086,19 @@ static int mtk_hdmi_output_init(struct mtk_hdmi *hdmi)
return 0;
 }

-void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
+static void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
 {
mtk_hdmi_aud_enable_packet(hdmi, true);
hdmi->audio_enable = true;
 }

-void mtk_hdmi_audio_disable(struct mtk_hdmi *hdmi)
+static void mtk_hdmi_audio_disable(struct mtk_hdmi *hdmi)
 {
mtk_hdmi_aud_enable_packet(hdmi, false);
hdmi->audio_enable = false;
 }

-int mtk_hdmi_audio_set_param(struct mtk_hdmi *hdmi,
+static int mtk_hdmi_audio_set_param(struct mtk_hdmi *hdmi,
 struct hdmi_audio_param *param)
 {
if (!hdmi->audio_enable) {
@@ -1624,7 +1624,8 @@ static void mtk_hdmi_audio_shutdown(struct device *dev, 
void *data)
mtk_hdmi_audio_disable(hdmi);
 }

-int mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable)
+static int
+mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable)
 {
struct mtk_hdmi *hdmi = dev_get_drvdata(dev);

-- 
2.7.4



[PATCH] drm/exynos: mark exynos_dp_crtc_clock_enable() static

2016-09-18 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/exynos/exynos_dp.c:46:5: warning: no previous prototype for 
'exynos_dp_crtc_clock_enable' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/exynos/exynos_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_dp.c 
b/drivers/gpu/drm/exynos/exynos_dp.c
index 4f08505..528229f 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -43,7 +43,7 @@ struct exynos_dp_device {
struct analogix_dp_plat_data plat_data;
 };

-int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
+static int exynos_dp_crtc_clock_enable(struct analogix_dp_plat_data *plat_data,
bool enable)
 {
struct exynos_dp_device *dp = to_dp(plat_data);
-- 
2.7.4



[PATCH] drm: bridge: analogix/dp: mark symbols static where possible

2016-09-18 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1053:5: warning: no previous 
prototype for 'analogix_dp_get_modes' [-Wmissing-prototypes]
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1097:1: warning: no previous 
prototype for 'analogix_dp_detect' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 
b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index efac8ab..e6f7290 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1050,7 +1050,7 @@ out:
return ret;
 }

-int analogix_dp_get_modes(struct drm_connector *connector)
+static int analogix_dp_get_modes(struct drm_connector *connector)
 {
struct analogix_dp_device *dp = to_dp(connector);
struct edid *edid = (struct edid *)dp->edid;
@@ -1093,7 +1093,7 @@ static const struct drm_connector_helper_funcs 
analogix_dp_connector_helper_func
.best_encoder = analogix_dp_best_encoder,
 };

-enum drm_connector_status
+static enum drm_connector_status
 analogix_dp_detect(struct drm_connector *connector, bool force)
 {
struct analogix_dp_device *dp = to_dp(connector);
-- 
2.7.4



[PATCH] drm/bochs: mark bochs_connector_get_modes() static

2016-09-18 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/bochs/bochs_kms.c:181:5: warning: no previous prototype for 
'bochs_connector_get_modes' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/bochs/bochs_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bochs/bochs_kms.c 
b/drivers/gpu/drm/bochs/bochs_kms.c
index 207a2cb..0b4e5d1 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -178,7 +178,7 @@ static void bochs_encoder_init(struct drm_device *dev)
 }


-int bochs_connector_get_modes(struct drm_connector *connector)
+static int bochs_connector_get_modes(struct drm_connector *connector)
 {
int count;

-- 
2.7.4



[PATCH] drm/amdgpu: amend amdgpu_gfx_parse_disable_cu() declaration

2016-09-18 Thread Baoyou Xie
In amdgpu_gfx.h, the declaration of amdgpu_gfx_parse_disable_cu()
is incorrect.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 +++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 5 -
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 01a42b6..8575039 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -82,7 +82,9 @@ void amdgpu_gfx_scratch_free(struct amdgpu_device *adev, 
uint32_t reg)
  * The bitmask of CUs to be disabled in the shader array determined by se and
  * sh is stored in mask[se * max_sh + sh].
  */
-void amdgpu_gfx_parse_disable_cu(unsigned *mask, unsigned max_se, unsigned 
max_sh)
+void amdgpu_gfx_parse_disable_cu(unsigned int *mask,
+   unsigned int max_se,
+   unsigned int max_sh)
 {
unsigned se, sh, cu;
const char *p;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 51321e1..0b9ad4f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -27,6 +27,9 @@
 int amdgpu_gfx_scratch_get(struct amdgpu_device *adev, uint32_t *reg);
 void amdgpu_gfx_scratch_free(struct amdgpu_device *adev, uint32_t reg);

-unsigned amdgpu_gfx_parse_disable_cu(unsigned *mask, unsigned max_se, unsigned 
max_sh);
+void
+amdgpu_gfx_parse_disable_cu(unsigned int *mask,
+  unsigned int max_se,
+  unsigned int max_sh);

 #endif
-- 
2.7.4



[PATCH] drm/amdgpu: add missing header dependencies

2016-09-18 Thread Baoyou Xie
We get 6 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c:629:6: warning: no previous prototype for 
'dce_v8_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c:730:6: warning: no previous prototype 
for 'dce_v10_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c:699:6: warning: no previous prototype 
for 'dce_v11_0_disable_dce' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:40:5: warning: no previous prototype 
for 'amdgpu_gfx_scratch_get' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:62:6: warning: no previous prototype 
for 'amdgpu_gfx_scratch_free' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:84:6: warning: no previous prototype 
for 'amdgpu_gfx_parse_disable_cu' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/amd/amdgpu/dce_v8_0.h
drivers/gpu/drm/amd/amdgpu/dce_v10_0.h
drivers/gpu/drm/amd/amdgpu/dce_v11_0.h
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c   | 1 +
 4 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index a074edd..01a42b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -24,6 +24,7 @@
  */
 #include 
 #include "amdgpu.h"
+#include "amdgpu_gfx.h"

 /*
  * GPU scratch registers helpers function.
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index bc5bb4e..fb943ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -35,6 +35,7 @@
 #include "dce/dce_10_0_d.h"
 #include "dce/dce_10_0_sh_mask.h"
 #include "dce/dce_10_0_enum.h"
+#include "dce_v10_0.h"
 #include "oss/oss_3_0_d.h"
 #include "oss/oss_3_0_sh_mask.h"
 #include "gmc/gmc_8_1_d.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index b93eba0..1555d6d 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -35,6 +35,7 @@
 #include "dce/dce_11_0_d.h"
 #include "dce/dce_11_0_sh_mask.h"
 #include "dce/dce_11_0_enum.h"
+#include "dce_v11_0.h"
 #include "oss/oss_3_0_d.h"
 #include "oss/oss_3_0_sh_mask.h"
 #include "gmc/gmc_8_1_d.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index abd5213..ef7add9 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -34,6 +34,7 @@

 #include "dce/dce_8_0_d.h"
 #include "dce/dce_8_0_sh_mask.h"
+#include "dce_v8_0.h"

 #include "gca/gfx_7_2_enum.h"

-- 
2.7.4



[PATCH] drm/msm: add missing header dependencies

2016-09-18 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/msm/msm_debugfs.c:141:5: warning: no previous prototype for 
'msm_debugfs_init' [-Wmissing-prototypes]
drivers/gpu/drm/msm/msm_debugfs.c:158:6: warning: no previous prototype for 
'msm_debugfs_cleanup' [-Wmissing-prototypes]

In fact, both functions are declared in drivers/gpu/drm/msm/msm_debugfs.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/msm/msm_debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/msm_debugfs.c 
b/drivers/gpu/drm/msm/msm_debugfs.c
index 663f2b6..3c85373 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -18,6 +18,7 @@
 #ifdef CONFIG_DEBUG_FS
 #include "msm_drv.h"
 #include "msm_gpu.h"
+#include "msm_debugfs.h"

 static int msm_gpu_show(struct drm_device *dev, struct seq_file *m)
 {
-- 
2.7.4



[PATCH] drm/nouveau/core: add missing header dependencies

2016-09-18 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:34:1: warning: no previous 
prototype for 'nvkm_firmware_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:58:1: warning: no previous 
prototype for 'nvkm_firmware_put' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c 
b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index 34ecd4a..058ff46 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include 
+#include 

 /**
  * nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
-- 
2.7.4



[PATCH] dma-buf/sw_sync: mark sync_timeline_create() static

2016-09-18 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma-buf/sw_sync.c:87:23: warning: no previous prototype for 
'sync_timeline_create' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/dma-buf/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 62e8e6d..6f16c85 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -84,7 +84,7 @@ static inline struct sync_pt *fence_to_sync_pt(struct fence 
*fence)
  * Creates a new sync_timeline. Returns the sync_timeline object or NULL in
  * case of error.
  */
-struct sync_timeline *sync_timeline_create(const char *name)
+static struct sync_timeline *sync_timeline_create(const char *name)
 {
struct sync_timeline *obj;

-- 
2.7.4



[PATCH] drm/radeon/radeon_device: remove unused function

2016-09-15 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/radeon/radeon_device.c:1961:5: warning: no previous prototype 
for 'radeon_debugfs_init' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_device.c:1966:6: warning: no previous prototype 
for 'radeon_debugfs_cleanup' [-Wmissing-prototypes]

In fact, these functions are dummy, but can be removed,
so this patch removes them.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/radeon_device.c | 11 ---
 drivers/gpu/drm/radeon/radeon_drv.c|  9 -
 2 files changed, 20 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index a00dd2f..63447f1 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1956,14 +1956,3 @@ static void radeon_debugfs_remove_files(struct 
radeon_device *rdev)
}
 #endif
 }
-
-#if defined(CONFIG_DEBUG_FS)
-int radeon_debugfs_init(struct drm_minor *minor)
-{
-   return 0;
-}
-
-void radeon_debugfs_cleanup(struct drm_minor *minor)
-{
-}
-#endif
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index 07e4493..86bab2e 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -156,11 +156,6 @@ void radeon_gem_prime_vunmap(struct drm_gem_object *obj, 
void *vaddr);
 extern long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg);

-#if defined(CONFIG_DEBUG_FS)
-int radeon_debugfs_init(struct drm_minor *minor);
-void radeon_debugfs_cleanup(struct drm_minor *minor);
-#endif
-
 /* atpx handler */
 #if defined(CONFIG_VGA_SWITCHEROO)
 void radeon_register_atpx_handler(void);
@@ -531,10 +526,6 @@ static struct drm_driver kms_driver = {
.disable_vblank = radeon_disable_vblank_kms,
.get_vblank_timestamp = radeon_get_vblank_timestamp_kms,
.get_scanout_position = radeon_get_crtc_scanoutpos,
-#if defined(CONFIG_DEBUG_FS)
-   .debugfs_init = radeon_debugfs_init,
-   .debugfs_cleanup = radeon_debugfs_cleanup,
-#endif
.irq_preinstall = radeon_driver_irq_preinstall_kms,
.irq_postinstall = radeon_driver_irq_postinstall_kms,
.irq_uninstall = radeon_driver_irq_uninstall_kms,
-- 
2.7.4



[PATCH] drm/amdgpu: clean function declarations in amdgpu_ttm.c up

2016-09-15 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:985:5: warning: no previous prototype 
for 'amdgpu_ttm_init' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1092:6: warning: no previous prototype 
for 'amdgpu_ttm_fini' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c, but should be declared in
a header file, thus can be recognized in other file.

So this patch moves the declarations into
drivers/gpu/drm/amd/amdgpu/amdgpu.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index a7bb862..3208608 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -2402,6 +2402,8 @@ void amdgpu_gtt_location(struct amdgpu_device *adev, 
struct amdgpu_mc *mc);
 void amdgpu_ttm_set_active_vram_size(struct amdgpu_device *adev, u64 size);
 u64 amdgpu_ttm_get_gtt_mem_size(struct amdgpu_device *adev);
 int amdgpu_ttm_global_init(struct amdgpu_device *adev);
+int amdgpu_ttm_init(struct amdgpu_device *adev);
+void amdgpu_ttm_fini(struct amdgpu_device *adev);
 void amdgpu_program_register_sequence(struct amdgpu_device *adev,
 const u32 *registers,
 const u32 array_size);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index b17734e..30f05d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -38,8 +38,6 @@
 #include "amdgpu_trace.h"


-int amdgpu_ttm_init(struct amdgpu_device *adev);
-void amdgpu_ttm_fini(struct amdgpu_device *adev);

 static u64 amdgpu_get_vis_part_size(struct amdgpu_device *adev,
struct ttm_mem_reg *mem)
-- 
2.7.4



[PATCH] drm/sti: mark symbols static where possible

2016-09-15 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/sti/sti_gdp.c:476:5: warning: no previous prototype for 
'sti_gdp_field_cb' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_hqvdp.c:786:5: warning: no previous prototype for 
'sti_hqvdp_vtg_cb' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_hqvdp.c:1292:5: warning: no previous prototype for 
'sti_hqvdp_bind' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_drv.c:143:6: warning: no previous prototype for 
'sti_drm_dbg_cleanup' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/sti/sti_drv.c   | 2 +-
 drivers/gpu/drm/sti/sti_gdp.c   | 2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 7cd3804..e6f0706 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -140,7 +140,7 @@ err:
return ret;
 }

-void sti_drm_dbg_cleanup(struct drm_minor *minor)
+static void sti_drm_dbg_cleanup(struct drm_minor *minor)
 {
drm_debugfs_remove_files(sti_drm_dbg_list,
 ARRAY_SIZE(sti_drm_dbg_list), minor);
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index b8d942c..4648d1b 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -473,7 +473,7 @@ static void sti_gdp_disable(struct sti_gdp *gdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_gdp_field_cb(struct notifier_block *nb,
+static int sti_gdp_field_cb(struct notifier_block *nb,
unsigned long event, void *data)
 {
struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb);
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index b5ee783..7f0dea8 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -783,7 +783,8 @@ static void sti_hqvdp_disable(struct sti_hqvdp *hqvdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
+static int
+sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
 {
struct sti_hqvdp *hqvdp = container_of(nb, struct sti_hqvdp, vtg_nb);
int btm_cmd_offset, top_cmd_offest;
@@ -1289,7 +1290,7 @@ static struct drm_plane *sti_hqvdp_create(struct 
drm_device *drm_dev,
return >plane.drm_plane;
 }

-int sti_hqvdp_bind(struct device *dev, struct device *master, void *data)
+static int sti_hqvdp_bind(struct device *dev, struct device *master, void 
*data)
 {
struct sti_hqvdp *hqvdp = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
-- 
2.7.4



[PATCH] drm/radeon/radeon_device: clean function declarations in radeon_device.c up

2016-09-14 Thread Baoyou Xie
On 14 September 2016 at 15:22, Christian König 
wrote:

> Am 14.09.2016 um 08:10 schrieb Baoyou Xie:
>
>> We get 2 warnings when building kernel with W=1:
>> drivers/gpu/drm/radeon/radeon_device.c:1961:5: warning: no previous
>> prototype for 'radeon_debugfs_init' [-Wmissing-prototypes]
>> drivers/gpu/drm/radeon/radeon_device.c:1966:6: warning: no previous
>> prototype for 'radeon_debugfs_cleanup' [-Wmissing-prototypes]
>>
>> In fact, both functions are declared in
>> drivers/gpu/drm/radeon/radeon_drv.c, but should be declared in
>> a header file, thus can be recognized in other file.
>>
>> So this patch moves the declarations into drivers/gpu/drm/radeon/radeon.
>> h.
>>
>> Signed-off-by: Baoyou Xie 
>>
>
> Actually if I see it correctly we could also just remove the two callbacks
> cause they are optional and our implementations are just empty dummys.
>
>
Is it sure? if true, we can simply remove them.

someone maybe implementation these functions in order to support debugfs.


> Christian.
>
>
> ---
>>   drivers/gpu/drm/radeon/radeon_device.c | 1 +
>>   drivers/gpu/drm/radeon/radeon_drv.c| 5 -
>>   drivers/gpu/drm/radeon/radeon_drv.h| 5 +
>>   3 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_device.c
>> b/drivers/gpu/drm/radeon/radeon_device.c
>> index a00dd2f..811abde 100644
>> --- a/drivers/gpu/drm/radeon/radeon_device.c
>> +++ b/drivers/gpu/drm/radeon/radeon_device.c
>> @@ -36,6 +36,7 @@
>>   #include 
>>   #include "radeon_reg.h"
>>   #include "radeon.h"
>> +#include "radeon_drv.h"
>>   #include "atom.h"
>> static const char radeon_family_name[][16] = {
>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
>> b/drivers/gpu/drm/radeon/radeon_drv.c
>> index 07e4493..6cc4a9e 100644
>> --- a/drivers/gpu/drm/radeon/radeon_drv.c
>> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
>> @@ -156,11 +156,6 @@ void radeon_gem_prime_vunmap(struct drm_gem_object
>> *obj, void *vaddr);
>>   extern long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd,
>> unsigned long arg);
>>   -#if defined(CONFIG_DEBUG_FS)
>> -int radeon_debugfs_init(struct drm_minor *minor);
>> -void radeon_debugfs_cleanup(struct drm_minor *minor);
>> -#endif
>> -
>>   /* atpx handler */
>>   #if defined(CONFIG_VGA_SWITCHEROO)
>>   void radeon_register_atpx_handler(void);
>> diff --git a/drivers/gpu/drm/radeon/radeon_drv.h
>> b/drivers/gpu/drm/radeon/radeon_drv.h
>> index afef2d9..3d35e0e 100644
>> --- a/drivers/gpu/drm/radeon/radeon_drv.h
>> +++ b/drivers/gpu/drm/radeon/radeon_drv.h
>> @@ -119,4 +119,9 @@
>>   long radeon_drm_ioctl(struct file *filp,
>>   unsigned int cmd, unsigned long arg);
>>   +#if defined(CONFIG_DEBUG_FS)
>> +int radeon_debugfs_init(struct drm_minor *minor);
>> +void radeon_debugfs_cleanup(struct drm_minor *minor);
>> +#endif
>> +
>>   #endif/* __RADEON_DRV_H__ */
>>
>
>
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20160914/842ffec2/attachment-0001.html>


[PATCH] drm/radeon/radeon_device: clean function declarations in radeon_device.c up

2016-09-14 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/radeon/radeon_device.c:1961:5: warning: no previous prototype 
for 'radeon_debugfs_init' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_device.c:1966:6: warning: no previous prototype 
for 'radeon_debugfs_cleanup' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/gpu/drm/radeon/radeon_drv.c, but should be declared in
a header file, thus can be recognized in other file.

So this patch moves the declarations into drivers/gpu/drm/radeon/radeon.h.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/radeon_device.c | 1 +
 drivers/gpu/drm/radeon/radeon_drv.c| 5 -
 drivers/gpu/drm/radeon/radeon_drv.h| 5 +
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index a00dd2f..811abde 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -36,6 +36,7 @@
 #include 
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_drv.h"
 #include "atom.h"

 static const char radeon_family_name[][16] = {
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index 07e4493..6cc4a9e 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -156,11 +156,6 @@ void radeon_gem_prime_vunmap(struct drm_gem_object *obj, 
void *vaddr);
 extern long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg);

-#if defined(CONFIG_DEBUG_FS)
-int radeon_debugfs_init(struct drm_minor *minor);
-void radeon_debugfs_cleanup(struct drm_minor *minor);
-#endif
-
 /* atpx handler */
 #if defined(CONFIG_VGA_SWITCHEROO)
 void radeon_register_atpx_handler(void);
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h 
b/drivers/gpu/drm/radeon/radeon_drv.h
index afef2d9..3d35e0e 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.h
+++ b/drivers/gpu/drm/radeon/radeon_drv.h
@@ -119,4 +119,9 @@
 long radeon_drm_ioctl(struct file *filp,
  unsigned int cmd, unsigned long arg);

+#if defined(CONFIG_DEBUG_FS)
+int radeon_debugfs_init(struct drm_minor *minor);
+void radeon_debugfs_cleanup(struct drm_minor *minor);
+#endif
+
 #endif /* __RADEON_DRV_H__ */
-- 
2.7.4



[PATCH] drm/nouveau/disp: remove unused function in sorg94.c

2016-09-13 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c:49:1: warning: no previous 
prototype for 'g94_sor_output_new' [-Wmissing-prototypes]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
index 1bb9d66..4510cb6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
@@ -45,14 +45,6 @@ static const struct nvkm_output_func
 g94_sor_output_func = {
 };

-int
-g94_sor_output_new(struct nvkm_disp *disp, int index,
-  struct dcb_output *dcbE, struct nvkm_output **poutp)
-{
-   return nvkm_output_new_(_sor_output_func, disp,
-   index, dcbE, poutp);
-}
-
 
/***
  * DisplayPort
  
**/
-- 
2.7.4



[PATCH] drm/radeon: add missing header dependencies

2016-09-08 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/radeon/radeon_clocks.c:35:10: warning: no previous prototype 
for 'radeon_legacy_get_engine_clock' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/atombios_encoders.c:75:1: warning: no previous prototype 
for 'atombios_get_backlight_level' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/r600_cs.c:2268:5: warning: no previous prototype for 
'r600_cs_parse' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/evergreen_cs.c:2671:5: warning: no previous prototype 
for 'evergreen_cs_parse' [-Wmissing-prototypes]


In fact, these functions are declared
in drivers/gpu/drm/radeon/radeon_asic.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/atombios_encoders.c  | 1 +
 drivers/gpu/drm/radeon/evergreen_cs.c   | 1 +
 drivers/gpu/drm/radeon/r600_cs.c| 1 +
 drivers/gpu/drm/radeon/radeon_atombios.c| 1 +
 drivers/gpu/drm/radeon/radeon_clocks.c  | 1 +
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 +
 6 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
b/drivers/gpu/drm/radeon/atombios_encoders.c
index 56bb758..fa4f8f0 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -28,6 +28,7 @@
 #include 
 #include "radeon.h"
 #include "radeon_audio.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include 

diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c 
b/drivers/gpu/drm/radeon/evergreen_cs.c
index d960d39..f8b0509 100644
--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -27,6 +27,7 @@
  */
 #include 
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "evergreend.h"
 #include "evergreen_reg_safe.h"
 #include "cayman_reg_safe.h"
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index b69c8de..595a197 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "r600d.h"
 #include "r600_reg_safe.h"

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5df3ec7..4134759 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -29,6 +29,7 @@

 #include "atom.h"
 #include "atom-bits.h"
+#include "radeon_asic.h"

 extern void
 radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c 
b/drivers/gpu/drm/radeon/radeon_clocks.c
index 38e396d..c1135fe 100644
--- a/drivers/gpu/drm/radeon/radeon_clocks.c
+++ b/drivers/gpu/drm/radeon/radeon_clocks.c
@@ -29,6 +29,7 @@
 #include 
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"

 /* 10 khz */
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 868c3ba..222a1fa 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include 
 #ifdef CONFIG_PMAC_BACKLIGHT
-- 
2.7.4



[PATCH] drm/tilcdc: mark symbols static where possible

2016-09-08 Thread Baoyou Xie
We get 3 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous 
prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous 
prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous 
prototype for 'tilcdc_slave_compat_init' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index f9c79da..dd8de260 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -139,7 +139,7 @@ static void __init tilcdc_node_disable(struct device_node 
*node)
of_update_property(node, prop);
 }

-struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
+static struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
 {
const int size = __dtb_tilcdc_slave_compat_end -
__dtb_tilcdc_slave_compat_begin;
@@ -195,7 +195,7 @@ static const char * const tilcdc_slave_props[] __initconst 
= {
NULL
 };

-void __init tilcdc_convert_slave_node(void)
+static void __init tilcdc_convert_slave_node(void)
 {
struct device_node *slave = NULL, *lcdc = NULL;
struct device_node *i2c = NULL, *fragment = NULL;
@@ -261,7 +261,7 @@ out:
of_node_put(fragment);
 }

-int __init tilcdc_slave_compat_init(void)
+static int __init tilcdc_slave_compat_init(void)
 {
tilcdc_convert_slave_node();
return 0;
-- 
2.7.4



[PATCH] drm/tilcdc: add missing header dependencies

2016-09-08 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:393:12: warning: no previous prototype 
for 'tilcdc_tfp410_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:398:13: warning: no previous prototype 
for 'tilcdc_tfp410_fini' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:443:12: warning: no previous prototype 
for 'tilcdc_panel_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:448:13: warning: no previous prototype 
for 'tilcdc_panel_fini' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/tilcdc/tilcdc_tfp410.h,
drivers/gpu/drm/tilcdc/tilcdc_panel.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 1 +
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index ff7774c..979394d 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -24,6 +24,7 @@
 #include 

 #include "tilcdc_drv.h"
+#include "tilcdc_panel.h"

 struct panel_module {
struct tilcdc_module base;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c 
b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index 6b8c5b3..455f032 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -22,6 +22,7 @@
 #include 

 #include "tilcdc_drv.h"
+#include "tilcdc_tfp410.h"

 struct tfp410_module {
struct tilcdc_module base;
-- 
2.7.4



[PATCH] drm/vc4: mark vc4_bo_cache_purge() static

2016-09-08 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/vc4/vc4_bo.c:147:6: warning: no previous prototype for 
'vc4_bo_cache_purge' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/vc4/vc4_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 59adcf8..3f6704c 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -144,7 +144,7 @@ static struct list_head *vc4_get_cache_list_for_size(struct 
drm_device *dev,
return >bo_cache.size_list[page_index];
 }

-void vc4_bo_cache_purge(struct drm_device *dev)
+static void vc4_bo_cache_purge(struct drm_device *dev)
 {
struct vc4_dev *vc4 = to_vc4_dev(dev);

-- 
2.7.4



[PATCH] drm/sun4i: add missing header dependencies

2016-09-08 Thread Baoyou Xie
We get 5 warnings when building kernel with W=1:
drivers/gpu/drm/sun4i/sun4i_framebuffer.c:33:23: warning: no previous prototype 
for 'sun4i_framebuffer_init' [-Wmissing-prototypes]
drivers/gpu/drm/sun4i/sun4i_framebuffer.c:47:6: warning: no previous prototype 
for 'sun4i_framebuffer_free' [-Wmissing-prototypes]
drivers/gpu/drm/sun4i/sun4i_rgb.c:202:5: warning: no previous prototype for 
'sun4i_rgb_init' [-Wmissing-prototypes]
drivers/gpu/drm/sun4i/sun4i_dotclock.c:151:5: warning: no previous prototype 
for 'sun4i_dclk_create' [-Wmissing-prototypes]
drivers/gpu/drm/sun4i/sun4i_dotclock.c:186:5: warning: no previous prototype 
for 'sun4i_dclk_free' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/sun4i/sun4i_framebuffer.h,
drivers/gpu/drm/sun4i/sun4i_rgb.h,
drivers/gpu/drm/sun4i/sun4i_dotclock.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c| 1 +
 drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 1 +
 drivers/gpu/drm/sun4i/sun4i_rgb.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c 
b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 5b34631..4332da4 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -14,6 +14,7 @@
 #include 

 #include "sun4i_tcon.h"
+#include "sun4i_dotclock.h"

 struct sun4i_dclk {
struct clk_hw   hw;
diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c 
b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
index 70688fe..8b6ce619 100644
--- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
@@ -15,6 +15,7 @@
 #include 

 #include "sun4i_drv.h"
+#include "sun4i_framebuffer.h"

 static void sun4i_de_output_poll_changed(struct drm_device *drm)
 {
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c 
b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index f5bbac6..3d11c48 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -19,6 +19,7 @@

 #include "sun4i_drv.h"
 #include "sun4i_tcon.h"
+#include "sun4i_rgb.h"

 struct sun4i_rgb {
struct drm_connectorconnector;
-- 
2.7.4



[PATCH] drm/radeon: mark symbols static where possible

2016-09-08 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/radeon/si.c:7868:5: warning: no previous prototype for 
'si_vce_send_vcepll_ctlreq' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:226:21: warning: no previous prototype 
for 'radeon_mst_best_encoder' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:344:26: warning: no previous prototype 
for 'radeon_mst_find_connector' [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_dp_mst.c:600:6: warning: no previous prototype 
for 'radeon_dp_mst_encoder_destroy' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/radeon/radeon_dp_mst.c | 8 +---
 drivers/gpu/drm/radeon/si.c| 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c 
b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index de504ea..6d1237d 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -223,7 +223,8 @@ radeon_dp_mst_mode_valid(struct drm_connector *connector,
return MODE_OK;
 }

-struct drm_encoder *radeon_mst_best_encoder(struct drm_connector *connector)
+static struct
+drm_encoder *radeon_mst_best_encoder(struct drm_connector *connector)
 {
struct radeon_connector *radeon_connector = 
to_radeon_connector(connector);

@@ -341,7 +342,8 @@ const struct drm_dp_mst_topology_cbs mst_cbs = {
.hotplug = radeon_dp_mst_hotplug,
 };

-struct radeon_connector *radeon_mst_find_connector(struct drm_encoder *encoder)
+static struct
+radeon_connector *radeon_mst_find_connector(struct drm_encoder *encoder)
 {
struct drm_device *dev = encoder->dev;
struct drm_connector *connector;
@@ -597,7 +599,7 @@ static const struct drm_encoder_helper_funcs 
radeon_mst_helper_funcs = {
.commit = radeon_mst_encoder_commit,
 };

-void radeon_dp_mst_encoder_destroy(struct drm_encoder *encoder)
+static void radeon_dp_mst_encoder_destroy(struct drm_encoder *encoder)
 {
drm_encoder_cleanup(encoder);
kfree(encoder);
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 2523ca9..57872d4 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -7865,7 +7865,7 @@ static void si_program_aspm(struct radeon_device *rdev)
}
 }

-int si_vce_send_vcepll_ctlreq(struct radeon_device *rdev)
+static int si_vce_send_vcepll_ctlreq(struct radeon_device *rdev)
 {
unsigned i;

-- 
2.7.4



[PATCH] drm/sti: mark symbols static where possible

2016-09-07 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/sti/sti_mixer.c:361:6: warning: no previous prototype for 
'sti_mixer_set_matrix' [-Wmissing-prototypes]
drivers/gpu/drm/sti/sti_dvo.c:109:5: warning: no previous prototype for 
'dvo_awg_generate_code' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/sti/sti_dvo.c   | 3 ++-
 drivers/gpu/drm/sti/sti_mixer.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 00881eb..4545ad0 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -106,7 +106,8 @@ struct sti_dvo_connector {
container_of(x, struct sti_dvo_connector, drm_connector)

 #define BLANKING_LEVEL 16
-int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
+static int
+dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code)
 {
struct drm_display_mode *mode = >mode;
struct dvo_config *config = dvo->config;
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index 7d9aea8..b78cec5 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -358,7 +358,7 @@ int sti_mixer_set_plane_status(struct sti_mixer *mixer,
return 0;
 }

-void sti_mixer_set_matrix(struct sti_mixer *mixer)
+static void sti_mixer_set_matrix(struct sti_mixer *mixer)
 {
unsigned int i;

-- 
2.7.4



  1   2   >