Re: [PATCH drm/hisilicon 2/3] drm/irq: Add the new api to install irq

2020-12-03 Thread Sam Ravnborg
Hi Tian,

> > +   ret = devm_add_action_or_reset(dev->dev, devm_drm_irq_uninstall, dev);
> > +   if (ret)
> > +   devm_drm_irq_uninstall(dev);
> devm_add_action_or_reset() will call devm_drm_irq_uninstall() if ret is
> != 0. See include/device.h.
> 
> I guess that is the "_or_reset" part of the name that can tell us that.
> So you can drop the if condition as it just will cause the code to call
> drm_irq_uninstall() twice.

Noticed this was fixed in v2 - so all is fine here.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 0/2] drm: add DisplayPort connector

2020-12-03 Thread Sam Ravnborg
Hi Tomi,
On Thu, Dec 03, 2020 at 01:52:21PM +0200, Tomi Valkeinen wrote:
> Hi DRM Bridge maintainers,
> 
> On 30/11/2020 13:29, Tomi Valkeinen wrote:
> > Hi,
> > 
> > This series adds the DT bindings and a driver for DisplayPort connector.
> > 
> > Minor changes since v3:
> > - Added Laurent's reviewed-bys
> > - Added $ref to graph schema
> > - Use 'ret' instead of 'r'
> > - Add the missing period
> > 
> >  Tomi
> > 
> > Tomi Valkeinen (2):
> >   dt-bindings: dp-connector: add binding for DisplayPort connector
> >   drm/bridge: display-connector: add DP support
> > 
> >  .../display/connector/dp-connector.yaml   | 56 +++
> >  drivers/gpu/drm/bridge/display-connector.c| 46 ++-
> >  2 files changed, 100 insertions(+), 2 deletions(-)
> >  create mode 100644 
> > Documentation/devicetree/bindings/display/connector/dp-connector.yaml
> > 
> 
> Is it ok for me to push this to drm-misc-next, or does one of the bridge 
> maintainers want to handle
> that?

IMO apply them to drm-misc-next.
But I am not bridge maintainer so...

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH drm/hisilicon 2/3] drm/irq: Add the new api to install irq

2020-12-03 Thread Sam Ravnborg
Hi Tian.

On Wed, Dec 02, 2020 at 04:47:14PM +0800, Tian Tao wrote:
> Add new api devm_drm_irq_install() to register interrupts,
> no need to call drm_irq_uninstall() when the drm module is removed.
> 
> Signed-off-by: Tian Tao 

Just a few details to fix.

Sam

> ---
>  drivers/gpu/drm/drm_irq.c | 35 +++
>  include/drm/drm_irq.h |  2 +-
>  2 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 09d6e9e..b363dec 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -214,6 +214,41 @@ int drm_irq_uninstall(struct drm_device *dev)
>  }
>  EXPORT_SYMBOL(drm_irq_uninstall);
>  
> +static void devm_drm_irq_uninstall(void *data)
> +{
> + drm_irq_uninstall(data);
> +}
> +
> +/**
> + * devm_drm_irq_install - install IRQ handler
> + * @dev: DRM device
> + * @irq: IRQ number to install the handler for
> + *
> + * devm_drm_irq_install is a  help function of drm_irq_install.
Drop the extra space after "is a"
> + *
> + * if the driver uses devm_drm_irq_install, there is no need
Start with capital "I" in If
> + * to call drm_irq_uninstall when the drm module get unloaded,
> + * as this will done automagically.
> + *
> + * Returns:
> + * Zero on success or a negative error code on failure.
> + */
> +int devm_drm_irq_install(struct drm_device *dev, int irq)
> +{
> + int ret;
> +
> + ret = drm_irq_install(dev, irq);
> + if (ret)
> + return ret;
> +
> + ret = devm_add_action_or_reset(dev->dev, devm_drm_irq_uninstall, dev);
> + if (ret)
> + devm_drm_irq_uninstall(dev);
devm_add_action_or_reset() will call devm_drm_irq_uninstall() if ret is
!= 0. See include/device.h.

I guess that is the "_or_reset" part of the name that can tell us that.
So you can drop the if condition as it just will cause the code to call
drm_irq_uninstall() twice.

> +
> + return ret;
> +}
> +EXPORT_SYMBOL(devm_drm_irq_install);
> +
>  #if IS_ENABLED(CONFIG_DRM_LEGACY)
>  int drm_legacy_irq_control(struct drm_device *dev, void *data,
>  struct drm_file *file_priv)
> diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h
> index d77f6e6..631b22f 100644
> --- a/include/drm/drm_irq.h
> +++ b/include/drm/drm_irq.h
> @@ -28,5 +28,5 @@ struct drm_device;
>  
>  int drm_irq_install(struct drm_device *dev, int irq);
>  int drm_irq_uninstall(struct drm_device *dev);
> -
> +int devm_drm_irq_install(struct drm_device *dev, int irq);
>  #endif
> -- 
> 2.7.4
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: panel: add flags to BOE NV110WTM-N61

2020-12-01 Thread Sam Ravnborg
Hi Doug,

On Tue, Dec 01, 2020 at 10:53:17AM -0800, Doug Anderson wrote:
> Hi,
> 
> On Mon, Nov 30, 2020 at 10:26 AM Sam Ravnborg  wrote:
> >
> > When applying a patch to add the BOE NV110WTM-N61 panel I forgot
> > to add the changes that added flags to drm_display_mode.
> 
> Sorry, I didn't mean to make more work for you!
> 
> 
> > Signed-off-by: Sam Ravnborg 
> > Fixes: a96ee0f6b58d ("drm: panel: simple: Add BOE NV110WTM-N61")
> > Cc: Douglas Anderson 
> > Cc: Sam Ravnborg 
> > Cc: Thierry Reding 
> > Cc: dri-devel@lists.freedesktop.org
> > ---
> >  drivers/gpu/drm/panel/panel-simple.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-simple.c 
> > b/drivers/gpu/drm/panel/panel-simple.c
> > index 216cde33b5c4..2d093b5a513c 100644
> > --- a/drivers/gpu/drm/panel/panel-simple.c
> > +++ b/drivers/gpu/drm/panel/panel-simple.c
> > @@ -1367,6 +1367,7 @@ static const struct drm_display_mode 
> > boe_nv101wxmn51_modes[] = {
> > .vsync_start = 800 + 3,
> > .vsync_end = 800 + 3 + 5,
> > .vtotal = 800 + 3 + 5 + 24,
> > +   .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
> > },
> > {
> > .clock = 57500,
> > @@ -1378,6 +1379,7 @@ static const struct drm_display_mode 
> > boe_nv101wxmn51_modes[] = {
> > .vsync_start = 800 + 3,
> > .vsync_end = 800 + 3 + 5,
> > .vtotal = 800 + 3 + 5 + 24,
> > +   .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
> 
> I think you're off by 10 and a letter.
> 
> The subject talks about:
>   NV110WTM-N61
> 
> You're modifying the structs for:
>   NV101WXM-N51
> 
> I'm happy to post this if it's helpful to you, or I can review a v2
> from you.  :-)
Please do so, that would be very nice.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v5 1/6] dt-bindings: display: simple: Add EDT ETM0700G0BDH6 display

2020-12-01 Thread Sam Ravnborg
Hi Oleksij

On Tue, Dec 01, 2020 at 10:27:37AM +0100, Oleksij Rempel wrote:
> This display is already supported by the panel-simple driver, so add it
> to the bindings documentation.
> 
> This patch is needed to fix checkpatch warnings for the PLYM2M dts.
> 
> Signed-off-by: Oleksij Rempel 
> ---
>  .../devicetree/bindings/display/panel/panel-simple.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml 
> b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> index edb53ab0d9eb..a011d9e44af3 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> @@ -117,6 +117,8 @@ properties:
>- edt,etm0700g0dh6
>  # Emerging Display Technology Corp. WVGA TFT Display with capacitive 
> touch
>  # Same as ETM0700G0DH6 but with inverted pixel clock.
> +  - edt,etm0700g0bdh6
> +# Emerging Display Technology Corp. WVGA TFT Display with capacitive 
> touch
>- edt,etm070080bdh6
>  # Emerging Display Technology Corp. WVGA TFT Display with capacitive 
> touch
>  # Same display as the ETM0700G0BDH6, but with changed hardware for 
> the

The panels should be listed in alphabetic order which is not the case
here. Could you fix the alphabetic order for the edt panels and then
insert the new panel in the right spot?

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v5] drm/bridge: add it6505 driver

2020-12-01 Thread Sam Ravnborg
Hi Allen.
On Tue, Dec 01, 2020 at 01:44:41PM +0800, allen wrote:
> This adds support for the iTE IT6505.
> This device can convert DPI signal to DP output.
> 
> From: Allen Chen 
> Signed-off-by: Jitao Shi 
> Signed-off-by: Pi-Hsun Shih 
> Signed-off-by: Yilun Lin 
> Signed-off-by: Hermes Wu 
> Signed-off-by: Allen Chen 

I recall I provided the same comment as last time, but may remember
wrong.

New bridge drivers shall support that connector creation is optional.
This driver does not do that - see following code snippet:

+   if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+   DRM_ERROR("Fix bridge driver to make connector optional!");
+   return -EINVAL;
+   }
+

I did not check, but likely the drive needs to implment some of the
connector hooks too. (detect, get_edid, etc).

Please include a changelog too - it can be very hard to remember what
feedback was provided when one reviews several patches/week.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

2020-12-01 Thread Sam Ravnborg
Hi Lee,

> 
> Cop-out!
> 
> Do what I do and make something up (joke)! :'D

If I thought anyone would actually read the comments then maybe yes.
But I assume that apart from this thread no-one will read it.

> 
> > > Well, it fixes the warning ;)
> > 
> > Yeah, I could not dig up anything useful to say here.
> > Was tempted to just drop all the kernel-doc syntax but that
> > was a larger change.
> 
> Did you trace it from it's origin down to it's final use?
Yeah, but not something that seemed useful.
I could have added "translating from pixels->bytes" as they
are described somewhere else. But I could not convince myself
this was right so I just silenced the warning.

The only reason I kept the kernel-doc in the first place is
that I am told some editors use it.

The only effect the kernel-doc in fbdev has right now is burning
effort that could have been spent (better?) somewhere else, and
I would personally prefer to drop the kernel-doc annotations.

But I already discussed this in another thread (not fbdev related)
and I was told it was useful for some, so it is kept.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 08/28] video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay

2020-11-30 Thread Sam Ravnborg
Hi Thomas.

On Mon, Nov 30, 2020 at 10:13:05AM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> > Fix W=1 warning by commenting unused SiS_TVDelay* variables.
> > 
> > The SiS_TVDelay* variables seem to contain some magic numbers
> > so looks like data worth keeping around but not as code we build.
> 
> I would remove it. sisfb is broken beyond repair and no one's going to try
> to use it anyway. In any case
> 
> Acked-by: Thomas Zimemrmann 

Thanks for your patience pointing out all my spelling and grammar errors.
I once had codespell set up to catch some of this, will need to do so
again.

Ironically I copied the above "Acked-by:" line to most of the commits
and just noticed it had a spelling error :-)

I have applied everything that you acked and will push when
I have fixed the above and verified I did not break anything.
Will post a v3 with the remaining patches later.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 21/28] video: fbdev: tmiofb: Fix set but not used warnings

2020-11-30 Thread Sam Ravnborg
Hi Thomas,

On Mon, Nov 30, 2020 at 03:36:44PM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:41 schrieb Sam Ravnborg:
> > Fix W=1 warnings by avoiding local variables and use direct references.
> 
> What's the bug here?

sh define iounmap like this:
#define iounmap(addr)   do { } while (0)

So par is not used resulting in a warning.

My patch just papers over the real issue.
The right fix is to fix sh so we reference addr.
Will give that a shot.

Sam

> 
> > 
> > v2:
> >- Updated subject (Lee)
> > 
> > Signed-off-by: Sam Ravnborg 
> > Cc: Daniel Vetter 
> > Cc: Sam Ravnborg 
> > Cc: Jani Nikula 
> > Cc: Lee Jones 
> > ---
> >   drivers/video/fbdev/tmiofb.c | 6 ++
> >   1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/tmiofb.c b/drivers/video/fbdev/tmiofb.c
> > index 50111966c981..b70faa3850f2 100644
> > --- a/drivers/video/fbdev/tmiofb.c
> > +++ b/drivers/video/fbdev/tmiofb.c
> > @@ -802,10 +802,8 @@ static int tmiofb_remove(struct platform_device *dev)
> > const struct mfd_cell *cell = mfd_get_cell(dev);
> > struct fb_info *info = platform_get_drvdata(dev);
> > int irq = platform_get_irq(dev, 0);
> > -   struct tmiofb_par *par;
> > if (info) {
> > -   par = info->par;
> > unregister_framebuffer(info);
> > tmiofb_hw_stop(dev);
> > @@ -816,8 +814,8 @@ static int tmiofb_remove(struct platform_device *dev)
> > free_irq(irq, info);
> > iounmap(info->screen_base);
> > -   iounmap(par->lcr);
> > -   iounmap(par->ccr);
> > +   iounmap(((struct tmiofb_par *)info->par)->lcr);
> > +   iounmap(((struct tmiofb_par *)info->par)->ccr);
> > framebuffer_release(info);
> > }
> > 
> 
> -- 
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
> 



___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

2020-11-30 Thread Sam Ravnborg
On Mon, Nov 30, 2020 at 01:14:52PM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> > Fix W=1 warnings:
> > - Fix kernel-doc
> > - Drop unused variables/code
> > 
> > v2:
> >- Updated subject (Lee)
> > 
> > Signed-off-by: Sam Ravnborg 
> > Cc: Antonino Daplas 
> > Cc: linux-fb...@vger.kernel.org
> > Cc: Lee Jones 
> > ---
> >   drivers/video/fbdev/riva/fbdev.c   |  9 -
> >   drivers/video/fbdev/riva/riva_hw.c | 28 
> >   2 files changed, 12 insertions(+), 25 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/riva/fbdev.c 
> > b/drivers/video/fbdev/riva/fbdev.c
> > index ce55b9d2e862..4b0433cb 100644
> > --- a/drivers/video/fbdev/riva/fbdev.c
> > +++ b/drivers/video/fbdev/riva/fbdev.c
> > @@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
> >   /**
> >* rivafb_load_cursor_image - load cursor image to hardware
> > - * @data: address to monochrome bitmap (1 = foreground color, 0 = 
> > background)
> > + * @data8: address to monochrome bitmap (1 = foreground color, 0 = 
> > background)
> >* @par:  pointer to private data
> >* @w:width of cursor image in pixels
> >* @h:height of cursor image in scanlines
> > @@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo 
> > *var,
> >   /**
> >* rivafb_do_maximize -
> >* @info: pointer to fb_info object containing info for current riva board
> > - * @var:
> > - * @nom:
> > - * @den:
> > + * @var: standard kernel fb changeable data
> > + * @nom: nom
> > + * @den: den
> 
> Well, it fixes the warning ;)

Yeah, I could not dig up anything useful to say here.
Was tempted to just drop all the kernel-doc syntax but that
was a larger change.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: panel: add flags to BOE NV110WTM-N61

2020-11-30 Thread Sam Ravnborg
When applying a patch to add the BOE NV110WTM-N61 panel I forgot
to add the changes that added flags to drm_display_mode.

Signed-off-by: Sam Ravnborg 
Fixes: a96ee0f6b58d ("drm: panel: simple: Add BOE NV110WTM-N61")
Cc: Douglas Anderson 
Cc: Sam Ravnborg 
Cc: Thierry Reding 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/panel/panel-simple.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index 216cde33b5c4..2d093b5a513c 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1367,6 +1367,7 @@ static const struct drm_display_mode 
boe_nv101wxmn51_modes[] = {
.vsync_start = 800 + 3,
.vsync_end = 800 + 3 + 5,
.vtotal = 800 + 3 + 5 + 24,
+   .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
},
{
.clock = 57500,
@@ -1378,6 +1379,7 @@ static const struct drm_display_mode 
boe_nv101wxmn51_modes[] = {
.vsync_start = 800 + 3,
.vsync_end = 800 + 3 + 5,
.vtotal = 800 + 3 + 5 + 24,
+   .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
},
 };
 
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Sam Ravnborg
Hi Peilin,
On Mon, Nov 30, 2020 at 01:38:05AM -0500, Peilin Ye wrote:
> Hi Sam,
> 
> On Sun, Nov 29, 2020 at 12:18:36PM +0100, Sam Ravnborg wrote:
> > On Sun, Nov 29, 2020 at 07:28:08PM +0900, Tetsuo Handa wrote:
> > > But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from 
> > > being printed
> > > when FBCONDEBUG is defined. Is such change what the author of this module 
> > > expects?
> > 
> > When someone goes and enable DEBUG for fbcon they are also able to
> > recognize the logging, so the printing of the function name is redundant
> > in this case.
> > 
> > There is likely limited to no use for these few logging entries, but if
> > they should be dropped then I expect Peilin Ye to do so as he is the
> > only one doing active maintenance of fbcon lately.
> 
> Sure, I will take another look at them. Also sorry for the delay in that
> printk() -> dev_*() patch you suggested, overwhelmed by some other
> things this week. Sometimes fbcon.c accesses dev structs in a pretty
> weird way (e.g. registered_fb[con2fb_map[vc->vc_num]]->dev), I will get
> back to it when I understand this better.
Please just keep up the good work cleaning up fbcon and related stuff.
This is an area that needs some love and care and there is work for many
long nights yet to do.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 4/5] drm: panel: simple: Add BOE NV110WTM-N61

2020-11-29 Thread Sam Ravnborg
Hi Douglas,

On Mon, Nov 09, 2020 at 05:00:58PM -0800, Douglas Anderson wrote:
> Add support for the BOE NV110WTM-N61 panel.  The EDID lists two modes
> (one for 60 Hz refresh rate and one for 40 Hz), so we'll list both of
> them here.
> 
> Note that the panel datasheet requires 80 ms between HPD asserting and
> the backlight power being turned on.  We'll use the new timing
> constraints structure to do this cleanly.  This assumes that the
> backlight will be enabled _after_ the panel enable finishes.  This is
> how it works today and seems a sane assumption.
> 
> Signed-off-by: Douglas Anderson 

I applied the binding patch (bindings before driver patch),
and added the missing flags while applying this patch.
All to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 3/5] drm: panel: simple: Allow specifying the delay from prepare to enable

2020-11-29 Thread Sam Ravnborg
Hi Douglas,

On Mon, Nov 09, 2020 at 05:00:57PM -0800, Douglas Anderson wrote:
> On the panel I'm looking at, there's an 80 ms minimum time between HPD
> being asserted by the panel and setting the backlight enable GPIO.
> While we could just add an 80 ms "enable" delay, this is not ideal.
> Link training is allowed to happen in parallel with this delay so the
> fixed 80 ms delay over-delays.
> 
> We'll support this by logging the time at the end of prepare and then
> delaying in enable if enough time hasn't passed.
> 
> Signed-off-by: Douglas Anderson 
Applied too.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 2/5] drm: panel: simple: Defer unprepare delay till next prepare to shorten it

2020-11-29 Thread Sam Ravnborg
Hi Douglas,
On Mon, Nov 09, 2020 at 05:00:56PM -0800, Douglas Anderson wrote:
> It is believed that all of the current users of the "unprepare" delay
> don't actually need to wait the amount of time specified directly in
> the unprepare phase.  The purpose of the delay that's specified is to
> allow the panel to fully power off so that we don't try to power it
> back on before it's managed to full power down.
> 
> Let's use this observation to avoid the fixed delay that we currently
> have.  Instead of delaying, we'll note the current time when the
> unprepare happens.  If someone then tries to prepare the panel later
> and not enough time has passed, we'll do the delay before starting the
> prepare phase.
> 
> Signed-off-by: Douglas Anderson 

Applied to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 1/5] drm: panel: simple: Fixup the struct panel_desc kernel doc

2020-11-29 Thread Sam Ravnborg
Hi Douglas,
On Mon, Nov 09, 2020 at 05:00:55PM -0800, Douglas Anderson wrote:
> When I run:
>   scripts/kernel-doc -rst drivers/gpu/drm/panel/panel-simple.c
> 
> I see that several of the kernel-doc entries aren't showing up because
> they don't specify the full path down the hierarchy.  Let's fix that
> and also move to inline kernel docs.
> 
> Signed-off-by: Douglas Anderson 

Thanks, applied to drm-misc-next.

Could you do a follow-up patch that moves the rest as inline comments
and verify that all fields are described.  (W=1 should show no warnings).
That would be appreciated!

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/kmb: Remove an unnecessary NULL check

2020-11-29 Thread Sam Ravnborg
Hi Anitha,

On Fri, Nov 20, 2020 at 05:28:59PM +, Chrisanthus, Anitha wrote:
> 
> 
> > -Original Message-
> > From: Thomas Zimmermann 
> > Sent: Friday, November 20, 2020 12:34 AM
> > To: Sam Ravnborg ; Chrisanthus, Anitha
> > 
> > Cc: David Airlie ; Dea, Edmund J ;
> > kernel-janit...@vger.kernel.org; dri-devel@lists.freedesktop.org; Dan
> > Carpenter 
> > Subject: Re: [PATCH] drm/kmb: Remove an unnecessary NULL check
> > 
> > Hi
> > 
> > Am 20.11.20 um 09:21 schrieb Sam Ravnborg:
> > > Hi Anitha.
> > >
> > > On Fri, Nov 20, 2020 at 01:19:06AM +, Chrisanthus, Anitha wrote:
> > >> Looks good to me.
> > >
> > > Can we get either an "Acked-by:" or "Reviewed-by:"?
> > > Then we can use this while applying.
> Sorry, forgot that.
> Reviewed-by: Anitha Chrisanthus 

Thanks, patch is now pushed to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 0/3] drm/ingenic: Add support for delta-RGB panels

2020-11-29 Thread Sam Ravnborg
Hi Paul.

On Thu, Nov 19, 2020 at 03:55:56PM +, Paul Cercueil wrote:
> Hi,
> 
> This patchset adds support for delta-RGB panels to the ingenic-drm
> driver. Delta-RGB panels have diamond-pattern subpixel layout, and
> expect odd lines to have RGB subpixel ordering, and even lines to have
> GBR subpixel ordering.
> 
> Such panel is used in the YLM (aka. Anbernic) RG-99, RG-300, RG-280M
> and RG-280V handheld gaming consoles.
> 
> Cheers,
> -Paul
> 
> Paul Cercueil (3):
>   drm/ingenic: Compute timings according to adjusted_mode->crtc_*
>   drm/ingenic: Properly compute timings when using a 3x8-bit panel
>   drm/ingenic: Add support for serial 8-bit delta-RGB panels

Strange panel, at least strange bit order.
Patches looks good and are all:
Reviewed-by: Sam Ravnborg 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] omapfb: fbcon: remove trailing semicolon in macro definition

2020-11-29 Thread Sam Ravnborg
Hi Tom,
On Fri, Nov 27, 2020 at 11:05:08AM -0800, t...@redhat.com wrote:
> From: Tom Rix 
> 
> The macro use will already have a semicolon.
> 
> Signed-off-by: Tom Rix 

Thanks, applied to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 28/28] video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

2020-11-29 Thread Sam Ravnborg
Hi Thomas.

On Sun, Nov 29, 2020 at 10:59:22AM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:41 schrieb Sam Ravnborg:
> > Fix following W=1 warnings:
> > - Fix set but not nused variables which was used only for logging.
> 
> s/nused/used
> 
> s/which was/that were
> 
> Otherwise
> 
> Reviewed-by: Thomas Zimmermann 

Fixed and applied to drm-misc-next.

Thanks for the a-b's and r-b. Are you up to take a look at the remaining
24 patches? It is all simple patches so should be doable in limited time.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Sam Ravnborg
On Sun, Nov 29, 2020 at 11:03:25AM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> > Replacing DPRINTK() statements with pr_debug fixes set but not used
> > warnings.  And moves to a more standard logging setup at the same time.
> > 
> > v2:
> >- Fix indent (Joe)
> > 
> > Signed-off-by: Sam Ravnborg 
> > Cc: Joe Perches 
> > Cc: Greg Kroah-Hartman 
> > Cc: Daniel Vetter 
> > Cc: Bartlomiej Zolnierkiewicz 
> > Cc: Sam Ravnborg 
> > Cc: Jiri Slaby 
> > Cc: Peilin Ye 
> > Cc: Tetsuo Handa 
> > Cc: George Kennedy 
> > Cc: Nathan Chancellor 
> > Cc: Peter Rosin 
> > ---
> >   drivers/video/fbdev/core/fbcon.c | 25 -
> >   1 file changed, 8 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/core/fbcon.c 
> > b/drivers/video/fbdev/core/fbcon.c
> > index bf61598bf1c3..44a5cd2f54cc 100644
> > --- a/drivers/video/fbdev/core/fbcon.c
> > +++ b/drivers/video/fbdev/core/fbcon.c
> > @@ -56,8 +56,6 @@
> >*  more details.
> >*/
> > -#undef FBCONDEBUG
> > -
> 
> I guess this was added for quick debugging during development. Anyway, I
> never liked these kinds of hacks.
> 
> Acked-by: Thomas Zimmermann 

Thanks, applied to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 01/28] video: Fix kernel-doc warnings in of_display_timing + of_videomode

2020-11-29 Thread Sam Ravnborg
On Sat, Nov 28, 2020 at 11:40:47PM +0100, Sam Ravnborg wrote:
> Fix kernel-doc warnings reported when using W=1.
> 
> v2:
>   - Improve subject (Lee)
> 
> Signed-off-by: Sam Ravnborg 
> Cc: Lee Jones 
> Cc: linux-fb...@vger.kernel.org

Applied to drm-misc-next after fixing nit that Thomas pointed out.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/panel: sony-acx565akm: Fix race condition in probe

2020-11-29 Thread Sam Ravnborg
Hi Sebastian,
On Fri, Nov 27, 2020 at 09:04:29PM +0100, Sebastian Reichel wrote:
> The probe routine acquires the reset GPIO using GPIOD_OUT_LOW. Directly
> afterwards it calls acx565akm_detect(), which sets the GPIO value to
> HIGH. If the bootloader initialized the GPIO to HIGH before the probe
> routine was called, there is only a very short time period of a few
> instructions where the reset signal is LOW. Exact time depends on
> compiler optimizations, kernel configuration and alignment of the stars,
> but I expect it to be always way less than 10us. There are no public
> datasheets for the panel, but acx565akm_power_on() has a comment with
> timings and reset period should be at least 10us. So this potentially
> brings the panel into a half-reset state.
> 
> The result is, that panel may not work after boot and can get into a
> working state by re-enabling it (e.g. by blanking + unblanking), since
> that does a clean reset cycle. This bug has recently been hit by Ivaylo
> Dimitrov, but there are some older reports which are probably the same
> bug. At least Tony Lindgren, Peter Ujfalusi and Jarkko Nikula have
> experienced it in 2017 describing the blank/unblank procedure as
> possible workaround.
> 
> Note, that the bug really goes back in time. It has originally been
> introduced in the predecessor of the omapfb driver in 3c45d05be382
> ("OMAPDSS: acx565akm panel: handle gpios in panel driver") in 2012.
> That driver eventually got replaced by a newer one, which had the bug
> from the beginning in 84192742d9c2 ("OMAPDSS: Add Sony ACX565AKM panel
> driver") and still exists in fbdev world. That driver has later been
> copied to omapdrm and then was used as a basis for this driver. Last
> but not least the omapdrm specific driver has been removed in
> 45f16c82db7e ("drm/omap: displays: Remove unused panel drivers").
> 
> Reported-by: Jarkko Nikula 
> Reported-by: Peter Ujfalusi 
> Reported-by: Tony Lindgren 
> Reported-by: Aaro Koskinen 
> Reported-by: Ivaylo Dimitrov 
> Cc: Merlijn Wajer 
> Cc: Laurent Pinchart 
> Cc: Tomi Valkeinen 
> Fixes: 1c8fc3f0c5d2 ("drm/panel: Add driver for the Sony ACX565AKM panel")
> Signed-off-by: Sebastian Reichel 


Fixed up the commit references, added Tested-by (impressive list) and
committed to drm-misc-fixes.

Commit references shall look like this:

commit 84192742d9c2 ("OMAPDSS: Add Sony ACX565AKM panel driver")

The word commit is required according to dim (the tool we use for
drm-misc maintenance).

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] msm/mdp5: Fix some kernel-doc warnings

2020-11-29 Thread Sam Ravnborg
Hi Rob,
On Sun, Nov 29, 2020 at 10:12:40AM -0800, Rob Clark wrote:
> From: Rob Clark 
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:227: warning: Function parameter or 
> member 'ctl' not described in 'mdp5_ctl_set_encoder_state'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:227: warning: Function parameter or 
> member 'pipeline' not described in 'mdp5_ctl_set_encoder_state'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:227: warning: Function parameter or 
> member 'enabled' not described in 'mdp5_ctl_set_encoder_state'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:227: warning: Excess function 
> parameter 'enable' description in 'mdp5_ctl_set_encoder_state'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:529: warning: Function parameter or 
> member 'ctl' not described in 'mdp5_ctl_commit'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:529: warning: Function parameter or 
> member 'pipeline' not described in 'mdp5_ctl_commit'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:529: warning: Function parameter or 
> member 'flush_mask' not described in 'mdp5_ctl_commit'
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c:529: warning: Function parameter or 
> member 'start' not described in 'mdp5_ctl_commit'
> 
> Cc: Lee Jones 
> Signed-off-by: Rob Clark 

Looks fine,
Acked-by: Sam Ravnborg 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 01/28] video: Fix kernel-doc warnings in of_display_timing + of_videomode

2020-11-29 Thread Sam Ravnborg
On Sun, Nov 29, 2020 at 11:01:13AM +0100, Thomas Zimmermann wrote:
> 
> 
> Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> > Fix kernel-doc warnings reported when using W=1.
> > 
> > v2:
> >- Improve subject (Lee)
> > 
> > Signed-off-by: Sam Ravnborg 
> > Cc: Lee Jones 
> > Cc: linux-fb...@vger.kernel.org
> > ---
> >   drivers/video/of_display_timing.c | 1 +
> >   drivers/video/of_videomode.c  | 8 
> >   2 files changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/video/of_display_timing.c 
> > b/drivers/video/of_display_timing.c
> > index abc9ada798ee..f93b6abbe258 100644
> > --- a/drivers/video/of_display_timing.c
> > +++ b/drivers/video/of_display_timing.c
> > @@ -52,6 +52,7 @@ static int parse_timing_property(const struct device_node 
> > *np, const char *name,
> >   /**
> >* of_parse_display_timing - parse display_timing entry from device_node
> >* @np: device_node with the properties
> > + * @dt: display_timing that contains the result. I may be partially 
> > written in case of errors
> >**/
> >   static int of_parse_display_timing(const struct device_node *np,
> > struct display_timing *dt)
> > diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c
> > index 67aff2421c29..a5bb02f02b44 100644
> > --- a/drivers/video/of_videomode.c
> > +++ b/drivers/video/of_videomode.c
> > @@ -13,10 +13,10 @@
> >   #include 
> >   /**
> > - * of_get_videomode - get the videomode # from devicetree
> 
> What's wrong with this line? We use the dash in lots of places?
I think my OCD kicked in and I made all lines use ':'.
I will re-add the dash when I apply.

> 
> Besides this,
> 
> Acked-by: Thomas Zimmermann 

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Sam Ravnborg
Hi Tetsuo,
On Sun, Nov 29, 2020 at 07:28:08PM +0900, Tetsuo Handa wrote:
> On 2020/11/29 19:03, Thomas Zimmermann wrote:
> > Am 28.11.20 um 23:40 schrieb Sam Ravnborg:
> >> Replacing DPRINTK() statements with pr_debug fixes set but not used
> >> warnings.  And moves to a more standard logging setup at the same time.
> > 
> > I guess this was added for quick debugging during development. Anyway, I 
> > never liked these kinds of hacks.
> > 
> > Acked-by: Thomas Zimmermann 
> > 
> 
> But replacing printk(KERN_DEBUG) with pr_debug() prevents __func__ from being 
> printed
> when FBCONDEBUG is defined. Is such change what the author of this module 
> expects?

When someone goes and enable DEBUG for fbcon they are also able to
recognize the logging, so the printing of the function name is redundant
in this case.

There is likely limited to no use for these few logging entries, but if
they should be dropped then I expect Peilin Ye to do so as he is the
only one doing active maintenance of fbcon lately.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 28/28] video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix following W=1 warnings:
- Fix set but not nused variables which was used only for logging.
  Fixed by introducing no_printk() to trick compiler to think variables
  are used
- Fix kernel-doc warning by deleting an empty comment line

v2:
  - Subject updated (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Kristoffer Ericson 
Cc: Lee Jones 
---
 drivers/video/fbdev/s1d13xxxfb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
index 4541afcf9386..d1b5f965bc96 100644
--- a/drivers/video/fbdev/s1d13xxxfb.c
+++ b/drivers/video/fbdev/s1d13xxxfb.c
@@ -45,7 +45,7 @@
 #if 0
 #define dbg(fmt, args...) do { printk(KERN_INFO fmt, ## args); } while(0)
 #else
-#define dbg(fmt, args...) do { } while (0)
+#define dbg(fmt, args...) do { no_printk(KERN_INFO fmt, ## args); } while (0)
 #endif
 
 /*
@@ -512,7 +512,6 @@ s1d13xxxfb_bitblt_copyarea(struct fb_info *info, const 
struct fb_copyarea *area)
 }
 
 /**
- *
  * s1d13xxxfb_bitblt_solidfill - accelerated solidfill function
  * @info : framebuffer structure
  * @rect : fb_fillrect structure
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 24/28] video: fbdev: s3c-fb: Fix kernel-doc and set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix several W=1 warnings
- Updated kernel-doc as needed
- Deleted unused local variable, it was assigned but never used

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Jingoo Han 
Cc: linux-fb...@vger.kernel.org
Cc: Lee Jones 
---
 drivers/video/fbdev/s3c-fb.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index ba316bd56efd..3b134e1bbc38 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -75,6 +75,7 @@ struct s3c_fb;
  * @buf_size: Offset of buffer size registers.
  * @buf_end: Offset of buffer end registers.
  * @osd: The base for the OSD registers.
+ * @osd_stride: stride of osd
  * @palette: Address of palette memory, or 0 if none.
  * @has_prtcon: Set if has PRTCON register.
  * @has_shadowcon: Set if has SHADOWCON register.
@@ -155,7 +156,7 @@ struct s3c_fb_palette {
  * @windata: The platform data supplied for the window configuration.
  * @parent: The hardware that this window is part of.
  * @fbinfo: Pointer pack to the framebuffer info for this window.
- * @varint: The variant information for this window.
+ * @variant: The variant information for this window.
  * @palette_buffer: Buffer/cache to hold palette entries.
  * @pseudo_palette: For use in TRUECOLOUR modes for entries 0..15/
  * @index: The window number of this window.
@@ -336,7 +337,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
 /**
  * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock.
  * @sfb: The hardware state.
- * @pixclock: The pixel clock wanted, in picoseconds.
+ * @pixclk: The pixel clock wanted, in picoseconds.
  *
  * Given the specified pixel clock, work out the necessary divider to get
  * close to the output frequency.
@@ -733,7 +734,7 @@ static inline unsigned int chan_to_field(unsigned int chan,
  * @red: The red field for the palette data.
  * @green: The green field for the palette data.
  * @blue: The blue field for the palette data.
- * @trans: The transparency (alpha) field for the palette data.
+ * @transp: The transparency (alpha) field for the palette data.
  * @info: The framebuffer being changed.
  */
 static int s3c_fb_setcolreg(unsigned regno,
@@ -1133,6 +1134,7 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct 
s3c_fb_win *win)
 
 /**
  * s3c_fb_release_win() - release resources for a framebuffer window.
+ * @sfb: The base resources for the hardware.
  * @win: The window to cleanup the resources for.
  *
  * Release the resources that where claimed for the hardware window,
@@ -1160,6 +1162,7 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct 
s3c_fb_win *win)
 /**
  * s3c_fb_probe_win() - register an hardware window
  * @sfb: The base resources for the hardware
+ * @win_no: The window number
  * @variant: The variant information for this window.
  * @res: Pointer to where to place the resultant window.
  *
@@ -1170,7 +1173,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned 
int win_no,
struct s3c_fb_win_variant *variant,
struct s3c_fb_win **res)
 {
-   struct fb_var_screeninfo *var;
struct fb_videomode initmode;
struct s3c_fb_pd_win *windata;
struct s3c_fb_win *win;
@@ -1198,7 +1200,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned 
int win_no,
 
win = fbinfo->par;
*res = win;
-   var = >var;
win->variant = *variant;
win->fbinfo = fbinfo;
win->parent = sfb;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 25/28] video: fbdev: uvesafb: Fix set but not used warning

2020-11-28 Thread Sam Ravnborg
Fix W=1 warning by deleting unused local variable.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Michal Januszewski 
Cc: linux-fb...@vger.kernel.org
Cc: Lee Jones 
---
 drivers/video/fbdev/uvesafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index def14ac0ebe1..8ee0fc9c63cf 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -554,12 +554,12 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask 
*task,
 static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
  struct uvesafb_par *par)
 {
-   int i, err;
+   int i;
 
uvesafb_reset(task);
task->t.regs.eax = 0x4f0a;
task->t.regs.ebx = 0x0;
-   err = uvesafb_exec(task);
+   uvesafb_exec(task);
 
if ((task->t.regs.eax & 0x) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 26/28] video: fbdev: uvesafb: Fix string related warnings

2020-11-28 Thread Sam Ravnborg
Two W=1 string related warnings.
- Using strncpy to copy string without null-termination generates a
  warning.  Use memcpy to copy only the relevant chars

- Fix a potential bug with a very long string, subtract one from the
  length to make room for the termination null.

Signed-off-by: Sam Ravnborg 
Cc: Michal Januszewski 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/uvesafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 8ee0fc9c63cf..45dc8da191e4 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -423,7 +423,7 @@ static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
task->t.flags = TF_VBEIB;
task->t.buf_len = sizeof(struct vbe_ib);
task->buf = >vbe_ib;
-   strncpy(par->vbe_ib.vbe_signature, "VBE2", 4);
+   memcpy(par->vbe_ib.vbe_signature, "VBE2", 4);
 
err = uvesafb_exec(task);
if (err || (task->t.regs.eax & 0x) != 0x004f) {
@@ -1871,7 +1871,7 @@ static ssize_t v86d_show(struct device_driver *dev, char 
*buf)
 static ssize_t v86d_store(struct device_driver *dev, const char *buf,
size_t count)
 {
-   strncpy(v86d_path, buf, PATH_MAX);
+   strncpy(v86d_path, buf, PATH_MAX - 1);
return count;
 }
 static DRIVER_ATTR_RW(v86d);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 19/28] video: fbdev: sstfb: Updated logging to fix set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix set but not used warnings by introducing no_printk variants
for the internal logging system for this driver.

Fix a new warning that popped up now that logging was checked for
correct printf format strings.

A more invasive fix had been to replace all the internal logging with
standard logging primitives - thats for another day.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Arnd Bergmann 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Alex Dewar 
Cc: Jani Nikula 
Cc: linux-fb...@vger.kernel.org
Cc: Lee Jones 
---
 drivers/video/fbdev/sstfb.c | 2 +-
 include/video/sstfb.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/sstfb.c b/drivers/video/fbdev/sstfb.c
index c05cdabeb11c..27d4b0ace2d6 100644
--- a/drivers/video/fbdev/sstfb.c
+++ b/drivers/video/fbdev/sstfb.c
@@ -1390,7 +1390,7 @@ static int sstfb_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
fix->smem_start, info->screen_base,
fix->smem_len >> 20);
 
-   f_ddprintk("regbase_virt: %#lx\n", par->mmio_vbase);
+   f_ddprintk("regbase_virt: %p\n", par->mmio_vbase);
f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
diff --git a/include/video/sstfb.h b/include/video/sstfb.h
index 28384f354773..d4a5e41d1173 100644
--- a/include/video/sstfb.h
+++ b/include/video/sstfb.h
@@ -23,7 +23,7 @@
 #  define SST_DEBUG_FUNC 1
 #  define SST_DEBUG_VAR  1
 #else
-#  define dprintk(X...)
+#  define dprintk(X...)no_printk(X)
 #  define SST_DEBUG_REG  0
 #  define SST_DEBUG_FUNC 0
 #  define SST_DEBUG_VAR  0
@@ -48,7 +48,7 @@
 #if (SST_DEBUG_FUNC > 1)
 #  define f_ddprintk(X...) dprintk(" " X)
 #else
-#  define f_ddprintk(X...)
+#  define f_ddprintk(X...) no_printk(X)
 #endif
 #if (SST_DEBUG_FUNC > 2)
 #  define f_dddprintk(X...)dprintk(" " X)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 07/28] video: fbdev: sis: Fix defined but not used warnings

2020-11-28 Thread Sam Ravnborg
init.h define static symbols, so should only be included
once. Drop the include from sis.h as it is not needed.
This fixes a lot of warnings seen with a W=1 build.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
Cc: Lee Jones 
---
 drivers/video/fbdev/sis/sis.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/sis/sis.h b/drivers/video/fbdev/sis/sis.h
index 9f4c3093ccb3..d632f096083b 100644
--- a/drivers/video/fbdev/sis/sis.h
+++ b/drivers/video/fbdev/sis/sis.h
@@ -15,7 +15,6 @@
 
 #include "vgatypes.h"
 #include "vstruct.h"
-#include "init.h"
 
 #define VER_MAJOR  1
 #define VER_MINOR  8
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 21/28] video: fbdev: tmiofb: Fix set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings by avoiding local variables and use direct references.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Lee Jones 
---
 drivers/video/fbdev/tmiofb.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/tmiofb.c b/drivers/video/fbdev/tmiofb.c
index 50111966c981..b70faa3850f2 100644
--- a/drivers/video/fbdev/tmiofb.c
+++ b/drivers/video/fbdev/tmiofb.c
@@ -802,10 +802,8 @@ static int tmiofb_remove(struct platform_device *dev)
const struct mfd_cell *cell = mfd_get_cell(dev);
struct fb_info *info = platform_get_drvdata(dev);
int irq = platform_get_irq(dev, 0);
-   struct tmiofb_par *par;
 
if (info) {
-   par = info->par;
unregister_framebuffer(info);
 
tmiofb_hw_stop(dev);
@@ -816,8 +814,8 @@ static int tmiofb_remove(struct platform_device *dev)
free_irq(irq, info);
 
iounmap(info->screen_base);
-   iounmap(par->lcr);
-   iounmap(par->ccr);
+   iounmap(((struct tmiofb_par *)info->par)->lcr);
+   iounmap(((struct tmiofb_par *)info->par)->ccr);
 
framebuffer_release(info);
}
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 27/28] video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix warnings:
- drop kernel-doc for the two debug functions to avoid the warnings
- delete unused code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Thomas Zimemrmann 
Cc: Sam Ravnborg 
Cc: "Gustavo A. R. Silva" 
Cc: Daniel Vetter 
Cc: Saeed Mirzamohammadi 
Cc: Jani Nikula 
Cc: Mike Rapoport 
Cc: Lee Jones 
---
 drivers/video/fbdev/cirrusfb.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c
index e9027172c0f5..93802abbbc72 100644
--- a/drivers/video/fbdev/cirrusfb.c
+++ b/drivers/video/fbdev/cirrusfb.c
@@ -2463,8 +2463,6 @@ static void AttrOn(const struct cirrusfb_info *cinfo)
  */
 static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
 {
-   unsigned char dummy;
-
if (is_laguna(cinfo))
return;
if (cinfo->btype == BT_PICASSO) {
@@ -2473,18 +2471,18 @@ static void WHDR(const struct cirrusfb_info *cinfo, 
unsigned char val)
WGen(cinfo, VGA_PEL_MSK, 0x00);
udelay(200);
/* next read dummy from pixel address (3c8) */
-   dummy = RGen(cinfo, VGA_PEL_IW);
+   RGen(cinfo, VGA_PEL_IW);
udelay(200);
}
/* now do the usual stuff to access the HDR */
 
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
 
WGen(cinfo, VGA_PEL_MSK, val);
@@ -2492,7 +2490,7 @@ static void WHDR(const struct cirrusfb_info *cinfo, 
unsigned char val)
 
if (cinfo->btype == BT_PICASSO) {
/* now first reset HDR access counter */
-   dummy = RGen(cinfo, VGA_PEL_IW);
+   RGen(cinfo, VGA_PEL_IW);
udelay(200);
 
/* and at the end, restore the mask value */
@@ -2800,9 +2798,9 @@ static void bestclock(long freq, int *nom, int *den, int 
*div)
 
 #ifdef CIRRUSFB_DEBUG
 
-/**
+/*
  * cirrusfb_dbg_print_regs
- * @base: If using newmmio, the newmmio base address, otherwise %NULL
+ * @regbase: If using newmmio, the newmmio base address, otherwise %NULL
  * @reg_class: type of registers to read: %CRT, or %SEQ
  *
  * DESCRIPTION:
@@ -2847,7 +2845,7 @@ static void cirrusfb_dbg_print_regs(struct fb_info *info,
va_end(list);
 }
 
-/**
+/*
  * cirrusfb_dbg_reg_dump
  * @base: If using newmmio, the newmmio base address, otherwise %NULL
  *
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 23/28] video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core

2020-11-28 Thread Sam Ravnborg
Fix a few W=1 warnings about unused assignments.
Drop the unused error code.

v2:
  - Subject updated (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Qilong Zhang 
Cc: "Alexander A. Klimov" 
Cc: Daniel Vetter 
Cc: Lee Jones 
---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c | 4 ++--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c 
b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
index 726c190862d4..e6363a420933 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
@@ -679,7 +679,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
struct hdmi_audio_format audio_format;
struct hdmi_audio_dma audio_dma;
struct hdmi_core_audio_config acore;
-   int err, n, cts, channel_count;
+   int n, cts, channel_count;
unsigned int fs_nr;
bool word_length_16b = false;
 
@@ -741,7 +741,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
return -EINVAL;
}
 
-   err = hdmi_compute_acr(pclk, fs_nr, , );
+   hdmi_compute_acr(pclk, fs_nr, , );
 
/* Audio clock regeneration settings */
acore.n = n;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c 
b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
index eda29d3032e1..cb63bc0e92ca 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
@@ -790,7 +790,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
struct hdmi_audio_format audio_format;
struct hdmi_audio_dma audio_dma;
struct hdmi_core_audio_config core_cfg;
-   int err, n, cts, channel_count;
+   int n, cts, channel_count;
unsigned int fs_nr;
bool word_length_16b = false;
 
@@ -833,7 +833,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
return -EINVAL;
}
 
-   err = hdmi_compute_acr(pclk, fs_nr, , );
+   hdmi_compute_acr(pclk, fs_nr, , );
core_cfg.n = n;
core_cfg.cts = cts;
 
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 22/28] video: fbdev: omapfb: Fix set but not used warnings in dsi

2020-11-28 Thread Sam Ravnborg
Fix several W=1 warnings.
This removes unused code and avoids an assignment by moving
the use inside the conditional block.

The register read FLD_GET(r, 15, 8) could be dropped as it was done a
few lines before too.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Aditya Pakki 
Cc: Sam Ravnborg 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Lee Jones 
---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c 
b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index 6f9c25fec994..72d45a02c3ac 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -1178,13 +1178,12 @@ static int dsi_regulator_init(struct platform_device 
*dsidev)
 
 static void _dsi_print_reset_status(struct platform_device *dsidev)
 {
-   u32 l;
int b0, b1, b2;
 
/* A dummy read using the SCP interface to any DSIPHY register is
 * required after DSIPHY reset to complete the reset of the DSI complex
 * I/O. */
-   l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
+   dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
 
if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) {
b0 = 28;
@@ -3627,7 +3626,7 @@ static int dsi_proto_config(struct platform_device 
*dsidev)
 static void dsi_proto_timings(struct platform_device *dsidev)
 {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
+   unsigned tlpx, tclk_zero, tclk_prepare;
unsigned tclk_pre, tclk_post;
unsigned ths_prepare, ths_prepare_ths_zero, ths_zero;
unsigned ths_trail, ths_exit;
@@ -3646,7 +3645,6 @@ static void dsi_proto_timings(struct platform_device 
*dsidev)
 
r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG1);
tlpx = FLD_GET(r, 20, 16) * 2;
-   tclk_trail = FLD_GET(r, 15, 8);
tclk_zero = FLD_GET(r, 7, 0);
 
r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG2);
@@ -4040,7 +4038,6 @@ static int dsi_update(struct omap_dss_device *dssdev, int 
channel,
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   u16 dw, dh;
 
dsi_perf_mark_setup(dsidev);
 
@@ -4049,11 +4046,8 @@ static int dsi_update(struct omap_dss_device *dssdev, 
int channel,
dsi->framedone_callback = callback;
dsi->framedone_data = data;
 
-   dw = dsi->timings.x_res;
-   dh = dsi->timings.y_res;
-
 #ifdef DSI_PERF_MEASURE
-   dsi->update_bytes = dw * dh *
+   dsi->update_bytes = dsi->timings.x_res * dsi->timings.y_res *
dsi_get_pixel_size(dsi->pix_fmt) / 8;
 #endif
dsi_update_screen_dispc(dsidev);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 20/28] video: fbdev: nvidia: Fix set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix warnings by deleting unused code. The register reads are
kept as it is unknown if there are any hidden side-effects.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Antonino Daplas 
Cc: linux-fb...@vger.kernel.org
Cc: Lee Jones 
---
 drivers/video/fbdev/nvidia/nv_setup.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_setup.c 
b/drivers/video/fbdev/nvidia/nv_setup.c
index 2fa68669613a..5404017e6957 100644
--- a/drivers/video/fbdev/nvidia/nv_setup.c
+++ b/drivers/video/fbdev/nvidia/nv_setup.c
@@ -89,9 +89,8 @@ u8 NVReadSeq(struct nvidia_par *par, u8 index)
 }
 void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
 {
-   volatile u8 tmp;
 
-   tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+   VGA_RD08(par->PCIO, par->IOBase + 0x0a);
if (par->paletteEnabled)
index &= ~0x20;
else
@@ -101,9 +100,7 @@ void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
 }
 u8 NVReadAttr(struct nvidia_par *par, u8 index)
 {
-   volatile u8 tmp;
-
-   tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+   VGA_RD08(par->PCIO, par->IOBase + 0x0a);
if (par->paletteEnabled)
index &= ~0x20;
else
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 13/28] video: fbdev: riva: Fix kernel-doc and set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Antonino Daplas 
Cc: linux-fb...@vger.kernel.org
Cc: Lee Jones 
---
 drivers/video/fbdev/riva/fbdev.c   |  9 -
 drivers/video/fbdev/riva/riva_hw.c | 28 
 2 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index ce55b9d2e862..4b0433cb 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
 
 /**
  * rivafb_load_cursor_image - load cursor image to hardware
- * @data: address to monochrome bitmap (1 = foreground color, 0 = background)
+ * @data8: address to monochrome bitmap (1 = foreground color, 0 = background)
  * @par:  pointer to private data
  * @w:width of cursor image in pixels
  * @h:height of cursor image in scanlines
@@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo *var,
 /**
  * rivafb_do_maximize - 
  * @info: pointer to fb_info object containing info for current riva board
- * @var:
- * @nom:
- * @den:
+ * @var: standard kernel fb changeable data
+ * @nom: nom
+ * @den: den
  *
  * DESCRIPTION:
  * .
@@ -1214,7 +1214,6 @@ static int rivafb_set_par(struct fb_info *info)
 /**
  * rivafb_pan_display
  * @var: standard kernel fb changeable data
- * @con: TODO
  * @info: pointer to fb_info object containing info for current riva board
  *
  * DESCRIPTION:
diff --git a/drivers/video/fbdev/riva/riva_hw.c 
b/drivers/video/fbdev/riva/riva_hw.c
index bcf9c4b4de31..8b829b720064 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -836,17 +836,17 @@ static void nv10CalcArbitration
 nv10_sim_state *arb
 )
 {
-int data, pagemiss, cas,width, video_enable, bpp;
-int nvclks, mclks, pclks, vpagemiss, crtpagemiss, vbs;
-int nvclk_fill, us_extra;
+int data, pagemiss, width, video_enable, bpp;
+int nvclks, mclks, pclks, vpagemiss, crtpagemiss;
+int nvclk_fill;
 int found, mclk_extra, mclk_loop, cbs, m1;
 int mclk_freq, pclk_freq, nvclk_freq, mp_enable;
-int us_m, us_m_min, us_n, us_p, video_drain_rate, crtc_drain_rate;
-int vus_m, vus_n, vus_p;
-int vpm_us, us_video, vlwm, cpm_us, us_crt,clwm;
+int us_m, us_m_min, us_n, us_p, crtc_drain_rate;
+int vus_m;
+int vpm_us, us_video, cpm_us, us_crt,clwm;
 int clwm_rnd_down;
-int craw, m2us, us_pipe, us_pipe_min, vus_pipe, p1clk, p2;
-int pclks_2_top_fifo, min_mclk_extra;
+int m2us, us_pipe_min, p1clk, p2;
+int min_mclk_extra;
 int us_min_mclk_extra;
 
 fifo->valid = 1;
@@ -854,16 +854,13 @@ static void nv10CalcArbitration
 mclk_freq = arb->mclk_khz;
 nvclk_freq = arb->nvclk_khz;
 pagemiss = arb->mem_page_miss;
-cas = arb->mem_latency;
 width = arb->memory_width/64;
 video_enable = arb->enable_video;
 bpp = arb->pix_bpp;
 mp_enable = arb->enable_mp;
 clwm = 0;
-vlwm = 1024;
 
 cbs = 512;
-vbs = 512;
 
 pclks = 4; /* lwm detect. */
 
@@ -924,17 +921,11 @@ static void nv10CalcArbitration
   us_min_mclk_extra = min_mclk_extra *1000*1000 / mclk_freq;
   us_n = nvclks*1000*1000 / nvclk_freq;/* nvclk latency in us */
   us_p = pclks*1000*1000 / pclk_freq;/* nvclk latency in us */
-  us_pipe = us_m + us_n + us_p;
   us_pipe_min = us_m_min + us_n + us_p;
-  us_extra = 0;
 
   vus_m = mclk_loop *1000*1000 / mclk_freq; /* Mclk latency in us */
-  vus_n = (4)*1000*1000 / nvclk_freq;/* nvclk latency in us */
-  vus_p = 0*1000*1000 / pclk_freq;/* pclk latency in us */
-  vus_pipe = vus_m + vus_n + vus_p;
 
   if(video_enable) {
-video_drain_rate = pclk_freq * 4; /* MB/s */
 crtc_drain_rate = pclk_freq * bpp/8; /* MB/s */
 
 vpagemiss = 1; /* self generating page miss */
@@ -993,7 +984,6 @@ static void nv10CalcArbitration
   else if(crtc_drain_rate * 100  >= nvclk_fill * 98) {
   clwm = 1024;
   cbs = 512;
-  us_extra = (cbs * 1000 * 1000)/ (8*width)/mclk_freq ;
   }
   }
   }
@@ -1010,7 +1000,6 @@ static void nv10CalcArbitration
 
   m1 = clwm + cbs -  1024; /* Amount of overfill */
   m2us = us_pipe_min + us_min_mclk_extra;
-  pclks_2_top_fifo = (1024-clwm)/(8*width);
 
   /* pclk cycles to drain */
   p1clk = m2us * pclk_freq/(1000*1000); 
@@ -1038,7 +1027,6 @@ static void nv10CalcArbitration
   min_mclk_extra--;
 }
   }
-  craw = clwm;
 
   if(clwm < (1024-cbs+8)) clwm = 1024-cbs+8;
   data = (int)(clwm);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 09/28] video: fbdev: sis: Fix set but not used warnings in init.c

2020-11-28 Thread Sam Ravnborg
Fix set bit not used warnings by removing the code the assign the
variables and the definition of the variables.
A register read is kept as it may have unknown side-effects.

This removes a lot of unused code - which is always a good thing to do.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
Cc: Lee Jones 
---
 drivers/video/fbdev/sis/init.c | 34 ++
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
index fde27feae5d0..b77ea1a8825a 100644
--- a/drivers/video/fbdev/sis/init.c
+++ b/drivers/video/fbdev/sis/init.c
@@ -2648,7 +2648,7 @@ static void
 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
unsigned short ModeIdIndex, unsigned short RRTI)
 {
-   unsigned short data, infoflag = 0, modeflag, resindex;
+   unsigned short data, infoflag = 0, modeflag;
 #ifdef CONFIG_FB_SIS_315
unsigned char  *ROMAddr  = SiS_Pr->VirtualRomBase;
unsigned short data2, data3;
@@ -2659,7 +2659,7 @@ SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned 
short ModeNo,
if(SiS_Pr->UseCustomMode) {
   infoflag = SiS_Pr->CInfoFlag;
} else {
-  resindex = SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
+  SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
   if(ModeNo > 0x13) {
 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
   }
@@ -3538,17 +3538,13 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
struct fb_var_screeninfo *var, bool writeres
 )
 {
-   unsigned short HRE, HBE, HRS, HBS, HDE, HT;
-   unsigned short VRE, VBE, VRS, VBS, VDE, VT;
-   unsigned char  sr_data, cr_data, cr_data2;
-   intA, B, C, D, E, F, temp;
+   unsigned short HRE, HBE, HRS, HDE;
+   unsigned short VRE, VBE, VRS, VDE;
+   unsigned char  sr_data, cr_data;
+   intB, C, D, E, F, temp;
 
sr_data = crdata[14];
 
-   /* Horizontal total */
-   HT =  crdata[0] | ((unsigned short)(sr_data & 0x03) << 8);
-   A = HT + 5;
-
/* Horizontal display enable end */
HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6);
E = HDE + 1;
@@ -3557,9 +3553,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2);
F = HRS - E - 3;
 
-   /* Horizontal blank start */
-   HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4);
-
sr_data = crdata[15];
cr_data = crdata[5];
 
@@ -3588,13 +3581,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
sr_data = crdata[13];
cr_data = crdata[7];
 
-   /* Vertical total */
-   VT  = crdata[6] |
-((unsigned short)(cr_data & 0x01) << 8) |
-((unsigned short)(cr_data & 0x20) << 4) |
-((unsigned short)(sr_data & 0x01) << 10);
-   A = VT + 2;
-
/* Vertical display enable end */
VDE = crdata[10] |
 ((unsigned short)(cr_data & 0x02) << 7) |
@@ -3609,14 +3595,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
 ((unsigned short)(sr_data & 0x08) << 7);
F = VRS + 1 - E;
 
-   cr_data2 = (crdata[16] & 0x01) << 5;
-
-   /* Vertical blank start */
-   VBS = crdata[11] |
-((unsigned short)(cr_data  & 0x08) << 5) |
-((unsigned short)(cr_data2 & 0x20) << 4) |
-((unsigned short)(sr_data  & 0x04) << 8);
-
/* Vertical blank end */
VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4);
temp = VBE - ((E - 1) & 511);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 18/28] video: fbdev: mx3fb: Fix kernel-doc, set but not used and string warnings

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code/variables
- Use memcpy to copy a string without zero-termination
  strncpy() generates a warning

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Laurent Pinchart 
Cc: Daniel Vetter 
Cc: Xiaofei Tan 
Cc: Arnd Bergmann 
Cc: Lee Jones 
---
 drivers/video/fbdev/mx3fb.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 894617ddabcb..fabb271337ed 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -445,7 +445,6 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 {
struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
-   uint32_t enabled;
unsigned long flags;
 
if (mx3_fbi->txd == NULL)
@@ -453,7 +452,7 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 
spin_lock_irqsave(>lock, flags);
 
-   enabled = sdc_fb_uninit(mx3_fbi);
+   sdc_fb_uninit(mx3_fbi);
 
spin_unlock_irqrestore(>lock, flags);
 
@@ -732,7 +731,7 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi);
 
 /**
  * mx3fb_set_fix() - set fixed framebuffer parameters from variable settings.
- * @info:  framebuffer information pointer
+ * @fbi:   framebuffer information pointer
  * @return:0 on success or negative error code on failure.
  */
 static int mx3fb_set_fix(struct fb_info *fbi)
@@ -740,7 +739,7 @@ static int mx3fb_set_fix(struct fb_info *fbi)
struct fb_fix_screeninfo *fix = >fix;
struct fb_var_screeninfo *var = >var;
 
-   strncpy(fix->id, "DISP3 BG", 8);
+   memcpy(fix->id, "DISP3 BG", 8);
 
fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
 
@@ -1105,6 +1104,8 @@ static void __blank(int blank, struct fb_info *fbi)
 
 /**
  * mx3fb_blank() - blank the display.
+ * @blank: blank value for the panel
+ * @fbi:   framebuffer information pointer
  */
 static int mx3fb_blank(int blank, struct fb_info *fbi)
 {
@@ -1126,7 +1127,7 @@ static int mx3fb_blank(int blank, struct fb_info *fbi)
 /**
  * mx3fb_pan_display() - pan or wrap the display
  * @var:   variable screen buffer information.
- * @info:  framebuffer information pointer.
+ * @fbi:   framebuffer information pointer.
  *
  * We look only at xoffset, yoffset and the FB_VMODE_YWRAP flag
  */
@@ -1387,6 +1388,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi)
 
 /**
  * mx3fb_init_fbinfo() - initialize framebuffer information object.
+ * @dev: the device
+ * @ops:   framebuffer device operations
  * @return:initialized framebuffer structure.
  */
 static struct fb_info *mx3fb_init_fbinfo(struct device *dev,
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 12/28] video: fbdev: tdfx: Fix set but not used warning in att_outb()

2020-11-28 Thread Sam Ravnborg
The tmp variable were assigned but the result was never used,
so delete the tmp variable.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: "Gustavo A. R. Silva" 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Daniel Vetter 
Cc: Arnd Bergmann 
Cc: Lee Jones 
---
 drivers/video/fbdev/tdfxfb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c
index f056d80f6359..67e37a62b07c 100644
--- a/drivers/video/fbdev/tdfxfb.c
+++ b/drivers/video/fbdev/tdfxfb.c
@@ -206,9 +206,7 @@ static inline u8 crt_inb(struct tdfx_par *par, u32 idx)
 
 static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val)
 {
-   unsigned char tmp;
-
-   tmp = vga_inb(par, IS1_R);
+   vga_inb(par, IS1_R);
vga_outb(par, ATT_IW, idx);
vga_outb(par, ATT_IW, val);
 }
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 17/28] video: fbdev: tgafb: Fix kernel-doc and set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Daniel Vetter 
Cc: Arnd Bergmann 
Cc: Joe Perches 
Cc: Lee Jones 
---
 drivers/video/fbdev/tgafb.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/tgafb.c b/drivers/video/fbdev/tgafb.c
index 666fbe2f671c..ae0cf5540636 100644
--- a/drivers/video/fbdev/tgafb.c
+++ b/drivers/video/fbdev/tgafb.c
@@ -555,7 +555,7 @@ tgafb_setcolreg(unsigned regno, unsigned red, unsigned 
green, unsigned blue,
 
 /**
  *  tgafb_blank - Optional function.  Blanks the display.
- *  @blank_mode: the blank mode we want.
+ *  @blank: the blank mode we want.
  *  @info: frame buffer structure that represents a single frame buffer
  */
 static int
@@ -837,7 +837,7 @@ tgafb_clut_imageblit(struct fb_info *info, const struct 
fb_image *image)
u32 *palette = ((u32 *)info->pseudo_palette);
unsigned long pos, line_length, i, j;
const unsigned char *data;
-   void __iomem *regs_base, *fb_base;
+   void __iomem *fb_base;
 
dx = image->dx;
dy = image->dy;
@@ -855,7 +855,6 @@ tgafb_clut_imageblit(struct fb_info *info, const struct 
fb_image *image)
if (dy + height > vyres)
height = vyres - dy;
 
-   regs_base = par->tga_regs_base;
fb_base = par->tga_fb_base;
 
pos = dy * line_length + (dx * 4);
@@ -1034,7 +1033,7 @@ tgafb_fillrect(struct fb_info *info, const struct 
fb_fillrect *rect)
 regs_base + TGA_MODE_REG);
 }
 
-/**
+/*
  *  tgafb_copyarea - REQUIRED function. Can use generic routines if
  *   non acclerated hardware and packed pixel based.
  *   Copies on area of the screen to another area.
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 14/28] video: fbdev: pm2fb: Fix kernel-doc warnings

2020-11-28 Thread Sam Ravnborg
Fixed a few kernel-doc issues to fix the warnings.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: "Gustavo A. R. Silva" 
Cc: Randy Dunlap 
Cc: Arnd Bergmann 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Jani Nikula 
Cc: Lee Jones 
---
 drivers/video/fbdev/pm2fb.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/pm2fb.c b/drivers/video/fbdev/pm2fb.c
index 27893fa139b0..c68725eebee3 100644
--- a/drivers/video/fbdev/pm2fb.c
+++ b/drivers/video/fbdev/pm2fb.c
@@ -1508,8 +1508,8 @@ static const struct fb_ops pm2fb_ops = {
  *
  * Initialise and allocate resource for PCI device.
  *
- * @param  pdevPCI device.
- * @param  id  PCI device ID.
+ * @pdev:  PCI device.
+ * @id:PCI device ID.
  */
 static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -1715,7 +1715,7 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
  *
  * Release all device resources.
  *
- * @param  pdevPCI device to clean up.
+ * @pdev:  PCI device to clean up.
  */
 static void pm2fb_remove(struct pci_dev *pdev)
 {
@@ -1756,7 +1756,7 @@ MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
 
 
 #ifndef MODULE
-/**
+/*
  * Parse user specified options.
  *
  * This is, comma-separated options following `video=pm2fb:'.
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 16/28] video: fbdev: hgafb: Fix kernel-doc warnings

2020-11-28 Thread Sam Ravnborg
Fix kernel-doc comments.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Ferenc Bakonyi 
Cc: linux-nvi...@lists.surfsouth.com
Cc: Lee Jones 
---
 drivers/video/fbdev/hgafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
index a45fcff1461f..69af72937844 100644
--- a/drivers/video/fbdev/hgafb.c
+++ b/drivers/video/fbdev/hgafb.c
@@ -358,7 +358,7 @@ static int hga_card_detect(void)
 /**
  * hgafb_open - open the framebuffer device
  * @info:pointer to fb_info object containing info for current hga board
- * @int:open by console system or userland.
+ * @init:open by console system or userland.
  */
 
 static int hgafb_open(struct fb_info *info, int init)
@@ -372,7 +372,7 @@ static int hgafb_open(struct fb_info *info, int init)
 /**
  * hgafb_open - open the framebuffer device
  * @info:pointer to fb_info object containing info for current hga board
- * @int:open by console system or userland.
+ * @init:open by console system or userland.
  */
 
 static int hgafb_release(struct fb_info *info, int init)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 15/28] video: fbdev: neofb: Fix set but not used warning for CursorMem

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings by removing unused code

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Andrew Morton 
Cc: Evgeny Novikov 
Cc: Jani Nikula 
Cc: Mike Rapoport 
Cc: Lee Jones 
---
 drivers/video/fbdev/neofb.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c
index 09a20d4ab35f..c0f4f402da3f 100644
--- a/drivers/video/fbdev/neofb.c
+++ b/drivers/video/fbdev/neofb.c
@@ -1843,7 +1843,6 @@ static int neo_init_hw(struct fb_info *info)
struct neofb_par *par = info->par;
int videoRam = 896;
int maxClock = 65000;
-   int CursorMem = 1024;
int CursorOff = 0x100;
 
DBG("neo_init_hw");
@@ -1895,19 +1894,16 @@ static int neo_init_hw(struct fb_info *info)
case FB_ACCEL_NEOMAGIC_NM2070:
case FB_ACCEL_NEOMAGIC_NM2090:
case FB_ACCEL_NEOMAGIC_NM2093:
-   CursorMem = 2048;
CursorOff = 0x100;
break;
case FB_ACCEL_NEOMAGIC_NM2097:
case FB_ACCEL_NEOMAGIC_NM2160:
-   CursorMem = 1024;
CursorOff = 0x100;
break;
case FB_ACCEL_NEOMAGIC_NM2200:
case FB_ACCEL_NEOMAGIC_NM2230:
case FB_ACCEL_NEOMAGIC_NM2360:
case FB_ACCEL_NEOMAGIC_NM2380:
-   CursorMem = 1024;
CursorOff = 0x1000;
 
par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 11/28] video: fbdev: via: Fix set but not used warning for mode_crt_table

2020-11-28 Thread Sam Ravnborg
Fix warning by deleting the variable. The function call
viafb_get_best_mode() were verified to have no side-effects,
and thus could be dropped too.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Florian Tobias Schandinat 
Cc: linux-fb...@vger.kernel.org
Cc: Lee Jones 
---
 drivers/video/fbdev/via/lcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/via/lcd.c b/drivers/video/fbdev/via/lcd.c
index 4a869402d120..088b962076b5 100644
--- a/drivers/video/fbdev/via/lcd.c
+++ b/drivers/video/fbdev/via/lcd.c
@@ -537,11 +537,9 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo 
*var, u16 cxres,
u32 clock;
struct via_display_timing timing;
struct fb_var_screeninfo panel_var;
-   const struct fb_videomode *mode_crt_table, *panel_crt_table;
+   const struct fb_videomode *panel_crt_table;
 
DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n");
-   /* Get mode table */
-   mode_crt_table = viafb_get_best_mode(set_hres, set_vres, 60);
/* Get panel table Pointer */
panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);
viafb_fill_var_timing_info(_var, panel_crt_table);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 06/28] video: fbdev: aty: Fix set but not used warnings in mach64_ct

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings about variables assigned but never used.
- One variable is only used when CONFIG_FB_ATY_GENERIC_LCD is defined
  Fix so variable is only defined with CONFIG_FB_ATY_GENERIC_LCD
- Several variables was only assigned by a call to aty_ld_le32().
  Drop the variables but keep the call to aty_ld_le32() as it may
  have unexpected side-effects.

v2:
  - Updated subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Lee Jones 
---
 drivers/video/fbdev/aty/mach64_ct.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/aty/mach64_ct.c 
b/drivers/video/fbdev/aty/mach64_ct.c
index f87cc81f4fa2..011b07e44e0d 100644
--- a/drivers/video/fbdev/aty/mach64_ct.c
+++ b/drivers/video/fbdev/aty/mach64_ct.c
@@ -281,10 +281,13 @@ static u32 aty_pll_to_var_ct(const struct fb_info *info, 
const union aty_pll *pl
 void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
 {
struct atyfb_par *par = (struct atyfb_par *) info->par;
-   u32 crtc_gen_cntl, lcd_gen_cntrl;
+   u32 crtc_gen_cntl;
u8 tmp, tmp2;
 
-   lcd_gen_cntrl = 0;
+#ifdef CONFIG_FB_ATY_GENERIC_LCD
+   u32 lcd_gen_cntrl = 0;
+#endif
+
 #ifdef DEBUG
printk("atyfb(%s): about to program:\n"
"pll_ext_cntl=0x%02x pll_gen_cntl=0x%02x 
pll_vclk_cntl=0x%02x\n",
@@ -402,7 +405,7 @@ static int aty_init_pll_ct(const struct fb_info *info, 
union aty_pll *pll)
struct atyfb_par *par = (struct atyfb_par *) info->par;
u8 mpost_div, xpost_div, sclk_post_div_real;
u32 q, memcntl, trp;
-   u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off;
+   u32 dsp_config;
 #ifdef DEBUG
int pllmclk, pllsclk;
 #endif
@@ -488,9 +491,9 @@ static int aty_init_pll_ct(const struct fb_info *info, 
union aty_pll *pll)
 
/* Allow BIOS to override */
dsp_config = aty_ld_le32(DSP_CONFIG, par);
-   dsp_on_off = aty_ld_le32(DSP_ON_OFF, par);
-   vga_dsp_config = aty_ld_le32(VGA_DSP_CONFIG, par);
-   vga_dsp_on_off = aty_ld_le32(VGA_DSP_ON_OFF, par);
+   aty_ld_le32(DSP_ON_OFF, par);
+   aty_ld_le32(VGA_DSP_CONFIG, par);
+   aty_ld_le32(VGA_DSP_ON_OFF, par);
 
if (dsp_config)
pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 
16;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 10/28] video: fbdev: sis: Fix set but not used warnings in sis_main

2020-11-28 Thread Sam Ravnborg
Fix warnings by dropping unused variable and the
unused assignments.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
Cc: Lee Jones 
---
 drivers/video/fbdev/sis/sis_main.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/sis/sis_main.c 
b/drivers/video/fbdev/sis/sis_main.c
index 03c736f6f3d0..266a5582f94d 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -5029,7 +5029,6 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info 
*ivideo, u8 regb)
static const u8 cs168[8] = {
0x48, 0x78, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00
};
-   u8 reg;
u8 v1;
u8 v2;
u8 v3;
@@ -5037,9 +5036,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info 
*ivideo, u8 regb)
SiS_SetReg(SISCR, 0xb0, 0x80); /* DDR2 dual frequency mode */
SiS_SetReg(SISCR, 0x82, 0x77);
SiS_SetReg(SISCR, 0x86, 0x00);
-   reg = SiS_GetReg(SISCR, 0x86);
+   SiS_GetReg(SISCR, 0x86);
SiS_SetReg(SISCR, 0x86, 0x88);
-   reg = SiS_GetReg(SISCR, 0x86);
+   SiS_GetReg(SISCR, 0x86);
v1 = cs168[regb]; v2 = cs160[regb]; v3 = cs158[regb];
if (ivideo->haveXGIROM) {
v1 = bios[regb + 0x168];
@@ -5049,9 +5048,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info 
*ivideo, u8 regb)
SiS_SetReg(SISCR, 0x86, v1);
SiS_SetReg(SISCR, 0x82, 0x77);
SiS_SetReg(SISCR, 0x85, 0x00);
-   reg = SiS_GetReg(SISCR, 0x85);
+   SiS_GetReg(SISCR, 0x85);
SiS_SetReg(SISCR, 0x85, 0x88);
-   reg = SiS_GetReg(SISCR, 0x85);
+   SiS_GetReg(SISCR, 0x85);
SiS_SetReg(SISCR, 0x85, v2);
SiS_SetReg(SISCR, 0x82, v3);
SiS_SetReg(SISCR, 0x98, 0x01);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 08/28] video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay

2020-11-28 Thread Sam Ravnborg
Fix W=1 warning by commenting unused SiS_TVDelay* variables.

The SiS_TVDelay* variables seem to contain some magic numbers
so looks like data worth keeping around but not as code we build.

v2:
  - Update subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
Cc: Lee Jones 
---
 drivers/video/fbdev/sis/oem310.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/sis/oem310.h b/drivers/video/fbdev/sis/oem310.h
index 8fce56e4482c..ed28755715ce 100644
--- a/drivers/video/fbdev/sis/oem310.h
+++ b/drivers/video/fbdev/sis/oem310.h
@@ -200,6 +200,7 @@ static const unsigned char 
SiS310_TVDelayCompensation_651302LV[] =  /* M650, 651,
0x33,0x33
 };
 
+#if 0 /* Not used */
 static const unsigned char SiS_TVDelay661_301[] =  /* 661, 
301 */
 {
0x44,0x44,
@@ -219,6 +220,7 @@ static const unsigned char SiS_TVDelay661_301B[] =  
/* 661, 301B et al */
0x44,0x44,
0x44,0x44
 };
+#endif
 
 static const unsigned char SiS310_TVDelayCompensation_LVDS[] = /* LVDS 
*/
 {
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 05/28] video: fbdev: aty: Fix set but not used warnings

2020-11-28 Thread Sam Ravnborg
Fix W=1 warnings about variables assigned but never used.

- Drop variables that was set but never used
- Make variable definition conditional om ATARI

v2:
  - Fix m68k build error (kernel test robot)
  - Improve subject (Lee Jones)

Signed-off-by: Sam Ravnborg 
Reported-by: kernel test robot  # m68k build fix
Cc: Lee Jones 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Joe Perches 
Cc: Vaibhav Gupta 
Cc: Jason Yan 
Cc: Randy Dunlap 
Cc: Jani Nikula 
---
 drivers/video/fbdev/aty/atyfb_base.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c 
b/drivers/video/fbdev/aty/atyfb_base.c
index c8feff0ee8da..83c8e809955a 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -2353,6 +2353,9 @@ static int aty_init(struct fb_info *info)
int gtb_memsize, has_var = 0;
struct fb_var_screeninfo var;
int ret;
+#ifdef CONFIG_ATARI
+   u8 dac_type;
+#endif
 
init_waitqueue_head(>vblank.wait);
spin_lock_init(>int_lock);
@@ -2360,13 +2363,12 @@ static int aty_init(struct fb_info *info)
 #ifdef CONFIG_FB_ATY_GX
if (!M64_HAS(INTEGRATED)) {
u32 stat0;
-   u8 dac_type, dac_subtype, clk_type;
+   u8 dac_subtype, clk_type;
stat0 = aty_ld_le32(CNFG_STAT0, par);
par->bus_type = (stat0 >> 0) & 0x07;
par->ram_type = (stat0 >> 3) & 0x07;
ramname = aty_gx_ram[par->ram_type];
/* FIXME: clockchip/RAMDAC probing? */
-   dac_type = (aty_ld_le32(DAC_CNTL, par) >> 16) & 0x07;
 #ifdef CONFIG_ATARI
clk_type = CLK_ATI18818_1;
dac_type = (stat0 >> 9) & 0x07;
@@ -2375,7 +2377,6 @@ static int aty_init(struct fb_info *info)
else
dac_subtype = (aty_ld_8(SCRATCH_REG1 + 1, par) & 0xF0) 
| dac_type;
 #else
-   dac_type = DAC_IBMRGB514;
dac_subtype = DAC_IBMRGB514;
clk_type = CLK_IBMRGB514;
 #endif
@@ -3062,7 +3063,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct 
fb_info *info,
if (dp == of_console_device) {
struct fb_var_screeninfo *var = _var;
unsigned int N, P, Q, M, T, R;
-   u32 v_total, h_total;
struct crtc crtc;
u8 pll_regs[16];
u8 clock_cntl;
@@ -3078,9 +3078,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct 
fb_info *info,
crtc.gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par);
aty_crtc_to_var(, var);
 
-   h_total = var->xres + var->right_margin + var->hsync_len + 
var->left_margin;
-   v_total = var->yres + var->lower_margin + var->vsync_len + 
var->upper_margin;
-
/*
 * Read the PLL to figure actual Refresh Rate.
 */
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-28 Thread Sam Ravnborg
Replacing DPRINTK() statements with pr_debug fixes set but not used
warnings.  And moves to a more standard logging setup at the same time.

v2:
  - Fix indent (Joe)

Signed-off-by: Sam Ravnborg 
Cc: Joe Perches 
Cc: Greg Kroah-Hartman 
Cc: Daniel Vetter 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Jiri Slaby 
Cc: Peilin Ye 
Cc: Tetsuo Handa 
Cc: George Kennedy 
Cc: Nathan Chancellor 
Cc: Peter Rosin 
---
 drivers/video/fbdev/core/fbcon.c | 25 -
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bf61598bf1c3..44a5cd2f54cc 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -56,8 +56,6 @@
  *  more details.
  */
 
-#undef FBCONDEBUG
-
 #include 
 #include 
 #include 
@@ -82,12 +80,6 @@
 
 #include "fbcon.h"
 
-#ifdef FBCONDEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## 
args)
-#else
-#  define DPRINTK(fmt, args...)
-#endif
-
 /*
  * FIXME: Locking
  *
@@ -1015,11 +1007,11 @@ static const char *fbcon_startup(void)
rows /= vc->vc_font.height;
vc_resize(vc, cols, rows);
 
-   DPRINTK("mode:   %s\n", info->fix.id);
-   DPRINTK("visual: %d\n", info->fix.visual);
-   DPRINTK("res:%dx%d-%d\n", info->var.xres,
-   info->var.yres,
-   info->var.bits_per_pixel);
+   pr_debug("mode:   %s\n", info->fix.id);
+   pr_debug("visual: %d\n", info->fix.visual);
+   pr_debug("res:%dx%d-%d\n", info->var.xres,
+info->var.yres,
+info->var.bits_per_pixel);
 
fbcon_add_cursor_timer(info);
return display_desc;
@@ -2013,7 +2005,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
y_diff < 0 || y_diff > virt_fh) {
const struct fb_videomode *mode;
 
-   DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
+   pr_debug("attempting resize %ix%i\n", var.xres, var.yres);
mode = fb_find_best_mode(, >modelist);
if (mode == NULL)
return -EINVAL;
@@ -2023,7 +2015,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
if (virt_w > var.xres/virt_fw || virt_h > var.yres/virt_fh)
return -EINVAL;
 
-   DPRINTK("resize now %ix%i\n", var.xres, var.yres);
+   pr_debug("resize now %ix%i\n", var.xres, var.yres);
if (con_is_visible(vc)) {
var.activate = FB_ACTIVATE_NOW |
FB_ACTIVATE_FORCE;
@@ -3299,8 +3291,7 @@ static void fbcon_exit(void)
 
if (info->queue.func)
pending = cancel_work_sync(>queue);
-   DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
-   "no"));
+   pr_debug("fbcon: %s pending work\n", (pending ? "canceled" : 
"no"));
 
for (j = first_fb_vc; j <= last_fb_vc; j++) {
if (con2fb_map[j] == i) {
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 04/28] video: fbdev: aty: Delete unused variable in radeon_monitor

2020-11-28 Thread Sam Ravnborg
Fix warning about variable that is asssigned a value but never used.
The variable was indeed never used so delete it.

Keep the call to radeon_probe_i2c_connector() as it may have
side-effects. It is unlikely but I could not verify that is was safe to
drop the call.

Signed-off-by: Sam Ravnborg 
Cc: Benjamin Herrenschmidt 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/aty/radeon_monitor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_monitor.c 
b/drivers/video/fbdev/aty/radeon_monitor.c
index 9966c58aa26c..df55e23b7a5a 100644
--- a/drivers/video/fbdev/aty/radeon_monitor.c
+++ b/drivers/video/fbdev/aty/radeon_monitor.c
@@ -488,12 +488,10 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
 #if defined(DEBUG) && defined(CONFIG_FB_RADEON_I2C)
{
u8 *EDIDs[4] = { NULL, NULL, NULL, NULL };
-   int mon_types[4] = {MT_NONE, MT_NONE, MT_NONE, MT_NONE};
int i;
 
for (i = 0; i < 4; i++)
-   mon_types[i] = radeon_probe_i2c_connector(rinfo,
- i+1, 
[i]);
+   radeon_probe_i2c_connector(rinfo, i + 1, 
[i]);
}
 #endif /* DEBUG */
/*
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 03/28] video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify

2020-11-28 Thread Sam Ravnborg
Fix kernel-doc warnings reported when using W=1

v2:
  - Improve subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Lee Jones 
Cc: Sam Ravnborg 
Cc: Randy Dunlap 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Daniel Vetter 
Cc: "Alexander A. Klimov" 
---
 drivers/video/fbdev/core/fb_notify.c | 3 ++-
 drivers/video/fbdev/core/fbmon.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_notify.c 
b/drivers/video/fbdev/core/fb_notify.c
index 74c2da528884..d85717b6e14a 100644
--- a/drivers/video/fbdev/core/fb_notify.c
+++ b/drivers/video/fbdev/core/fb_notify.c
@@ -38,7 +38,8 @@ EXPORT_SYMBOL(fb_unregister_client);
 
 /**
  * fb_notifier_call_chain - notify clients of fb_events
- *
+ * @val: value passed to callback
+ * @v: pointer passed to callback
  */
 int fb_notifier_call_chain(unsigned long val, void *v)
 {
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 1bf82dbc9e3c..b0e690f41025 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -605,6 +605,7 @@ static void get_detailed_timing(unsigned char *block,
  * fb_create_modedb - create video mode database
  * @edid: EDID data
  * @dbsize: database size
+ * @specs: monitor specifications, may be NULL
  *
  * RETURNS: struct fb_videomode, @dbsize contains length of database
  *
@@ -1100,7 +1101,6 @@ static u32 fb_get_hblank_by_hfreq(u32 hfreq, u32 xres)
  *2 * M
  *M = 300;
  *C = 30;
-
  */
 static u32 fb_get_hblank_by_dclk(u32 dclk, u32 xres)
 {
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 01/28] video: Fix kernel-doc warnings in of_display_timing + of_videomode

2020-11-28 Thread Sam Ravnborg
Fix kernel-doc warnings reported when using W=1.

v2:
  - Improve subject (Lee)

Signed-off-by: Sam Ravnborg 
Cc: Lee Jones 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/of_display_timing.c | 1 +
 drivers/video/of_videomode.c  | 8 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/video/of_display_timing.c 
b/drivers/video/of_display_timing.c
index abc9ada798ee..f93b6abbe258 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -52,6 +52,7 @@ static int parse_timing_property(const struct device_node 
*np, const char *name,
 /**
  * of_parse_display_timing - parse display_timing entry from device_node
  * @np: device_node with the properties
+ * @dt: display_timing that contains the result. I may be partially written in 
case of errors
  **/
 static int of_parse_display_timing(const struct device_node *np,
struct display_timing *dt)
diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c
index 67aff2421c29..a5bb02f02b44 100644
--- a/drivers/video/of_videomode.c
+++ b/drivers/video/of_videomode.c
@@ -13,10 +13,10 @@
 #include 
 
 /**
- * of_get_videomode - get the videomode # from devicetree
- * @np - devicenode with the display_timings
- * @vm - set to return value
- * @index - index into list of display_timings
+ * of_get_videomode: get the videomode # from devicetree
+ * @np: devicenode with the display_timings
+ * @vm: set to return value
+ * @index: index into list of display_timings
  * (Set this to OF_USE_NATIVE_MODE to use whatever mode is
  *  specified as native mode in the DT.)
  *
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 0/28] drivers/video: W=1 warning fixes

2020-11-28 Thread Sam Ravnborg
Following the great work of Lee Jones in other subsystems
here is a set of patches that address all remaining W=1
warnings in drivers/video/.
Lee Jones already fixed all warnings in video/backlight/ so
this is mostly fbdev related fixes.

The general approach used were:
- Fix kernel-doc, this is often very trivial
- Drop unused local variables
- Use no_printk for local logging support

Build tested on a set of architectures with various configs.

The patches do not depends on each other and in most cases all
fixes for one driver is kept in a single patch.

The individual changes are trivial so this is a great
starter task to try to review these patches.

A timely Reviewed-by: or Acked-by: would be very nice so we can
get the warnings fixes before we cut for the merge window.

v2:
  - Updated subject of the patches to tell what was fixed (Lee)
  - Fixed build error in one patch (kernel test robot)
  - A few editorials updates to the changelog messages

Sam

Sam Ravnborg (28):
  video: Fix kernel-doc warnings in of_display_timing + of_videomode
  video: fbcon: Fix warnings by using pr_debug() in fbcon
  video: fbdev: core: Fix kernel-doc warnings in fbmon + fb_notify
  video: fbdev: aty: Delete unused variable in radeon_monitor
  video: fbdev: aty: Fix set but not used warnings
  video: fbdev: aty: Fix set but not used warnings in mach64_ct
  video: fbdev: sis: Fix defined but not used warnings
  video: fbdev: sis: Fix defined but not used warning of SiS_TVDelay
  video: fbdev: sis: Fix set but not used warnings in init.c
  video: fbdev: sis: Fix set but not used warnings in sis_main
  video: fbdev: via: Fix set but not used warning for mode_crt_table
  video: fbdev: tdfx: Fix set but not used warning in att_outb()
  video: fbdev: riva: Fix kernel-doc and set but not used warnings
  video: fbdev: pm2fb: Fix kernel-doc warnings
  video: fbdev: neofb: Fix set but not used warning for CursorMem
  video: fbdev: hgafb: Fix kernel-doc warnings
  video: fbdev: tgafb: Fix kernel-doc and set but not used warnings
  video: fbdev: mx3fb: Fix kernel-doc, set but not used and string warnings
  video: fbdev: sstfb: Updated logging to fix set but not used warnings
  video: fbdev: nvidia: Fix set but not used warnings
  video: fbdev: tmiofb: Fix set but not used warnings
  video: fbdev: omapfb: Fix set but not used warnings in dsi
  video: fbdev: omapfb: Fix set but not used warnings in hdmi*_core
  video: fbdev: s3c-fb: Fix kernel-doc and set but not used warnings
  video: fbdev: uvesafb: Fix set but not used warning
  video: fbdev: uvesafb: Fix string related warnings
  video: fbdev: cirrusfb: Fix kernel-doc and set but not used warnings
  video: fbdev: s1d13xxxfb: Fix kernel-doc and set but not used warnings

 drivers/video/fbdev/aty/atyfb_base.c  | 11 +++-
 drivers/video/fbdev/aty/mach64_ct.c   | 15 ++
 drivers/video/fbdev/aty/radeon_monitor.c  |  4 +--
 drivers/video/fbdev/cirrusfb.c| 20 ++---
 drivers/video/fbdev/core/fb_notify.c  |  3 +-
 drivers/video/fbdev/core/fbcon.c  | 25 ++---
 drivers/video/fbdev/core/fbmon.c  |  2 +-
 drivers/video/fbdev/hgafb.c   |  4 +--
 drivers/video/fbdev/mx3fb.c   | 13 +
 drivers/video/fbdev/neofb.c   |  4 ---
 drivers/video/fbdev/nvidia/nv_setup.c |  7 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c| 12 ++--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c |  4 +--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c |  4 +--
 drivers/video/fbdev/pm2fb.c   |  8 +++---
 drivers/video/fbdev/riva/fbdev.c  |  9 +++---
 drivers/video/fbdev/riva/riva_hw.c| 28 ++-
 drivers/video/fbdev/s1d13xxxfb.c  |  3 +-
 drivers/video/fbdev/s3c-fb.c  | 11 
 drivers/video/fbdev/sis/init.c| 34 ---
 drivers/video/fbdev/sis/oem310.h  |  2 ++
 drivers/video/fbdev/sis/sis.h |  1 -
 drivers/video/fbdev/sis/sis_main.c|  9 +++---
 drivers/video/fbdev/sstfb.c   |  2 +-
 drivers/video/fbdev/tdfxfb.c  |  4 +--
 drivers/video/fbdev/tgafb.c   |  7 ++---
 drivers/video/fbdev/tmiofb.c  |  6 ++--
 drivers/video/fbdev/uvesafb.c |  8 +++---
 drivers/video/fbdev/via/lcd.c |  4 +--
 drivers/video/of_display_timing.c |  1 +
 drivers/video/of_videomode.c  |  8 +++---
 include/video/sstfb.h |  4 +--
 32 files changed, 107 insertions(+), 170 deletions(-)


___
dri-devel

Re: [PATCH] drm/ingenic: Add basic PM support

2020-11-28 Thread Sam Ravnborg
Hi Paul.

On Sat, Nov 28, 2020 at 05:16:06PM +, Paul Cercueil wrote:
> Call drm_mode_config_helper_suspend() and
> drm_mode_config_helper_resume() on suspend and resume, respectively.
> 
> This makes sure that the display stack is properly disabled when the
> hardware is put to sleep.
> 
> Signed-off-by: Paul Cercueil 

As discussed on irc, with resume fixed to return the result of the
drm_mode_config_helper_resume() call.

Reviewed-by: Sam Ravnborg 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 01/28] video: Fix W=1 warnings in of_videomode + of_display_timing

2020-11-28 Thread Sam Ravnborg
Hi Lee,
On Sat, Nov 28, 2020 at 08:28:20AM +, Lee Jones wrote:
> On Fri, 27 Nov 2020, Sam Ravnborg wrote:
> 
> > Fix trivial W=1 warnings.
> > Update kernel-doc to avoid the warnings.
> 
> Can you put what's being fixed in the subject line please?
> 
> "fix w=1 warnings" is very bland and this it is unlikely to be the
> only w=1 warning that gets fixed in these files, so has a high likely
> hood of having an identical subject-line as a previous/future patch.
> 
> With regards to the latter point; I have personally found subject
> lines to be a pretty reliable way of maintaining/backporting older
> kernels.  The nomenclature here would taint that pretty readily.

Thanks for the feedback and the background for your comment.
Will fix them all for v2,

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 02/28] video: fbcon: Use pr_debug() in fbcon

2020-11-27 Thread Sam Ravnborg
Hi Joe.

On Fri, Nov 27, 2020 at 01:16:41PM -0800, Joe Perches wrote:
> On Fri, 2020-11-27 at 20:57 +0100, Sam Ravnborg wrote:
> > Replacing DPRINTK() statements with pr_debug fixes
> > W=1 warnings.
> > And moves to a more standard logging setup at the same time.
> []
> > diff --git a/drivers/video/fbdev/core/fbcon.c 
> > b/drivers/video/fbdev/core/fbcon.c
> []
> > @@ -1015,9 +1007,9 @@ static const char *fbcon_startup(void)
> >     rows /= vc->vc_font.height;
> >     vc_resize(vc, cols, rows);
> >  
> > 
> > -   DPRINTK("mode:   %s\n", info->fix.id);
> > -   DPRINTK("visual: %d\n", info->fix.visual);
> > -   DPRINTK("res:%dx%d-%d\n", info->var.xres,
> > +   pr_debug("mode:   %s\n", info->fix.id);
> > +   pr_debug("visual: %d\n", info->fix.visual);
> > +   pr_debug("res:%dx%d-%d\n", info->var.xres,
> >     info->var.yres,
> >     info->var.bits_per_pixel);
> 
> It'd be nicer to reindent the subsequent lines too.
> 
> > @@ -3299,7 +3291,7 @@ static void fbcon_exit(void)
> >  
> > 
> >     if (info->queue.func)
> >     pending = cancel_work_sync(>queue);
> > -   DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
> > +   pr_debug("fbcon: %s pending work\n", (pending ? "canceled" :
> >     "no"));
> 
> perhaps:
> 
>   pr_debug("fbcon: %s pending work\n", pending ? "canceled" : 
> "no");
> 
Good suggestions, I will update accordingly in v2 or when applying in
case someone acks/r-b's the patches.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 21/28] video: fbdev: tmiofb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings by avoiding local variables and use direct references.

Signed-off-by: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
---
 drivers/video/fbdev/tmiofb.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/tmiofb.c b/drivers/video/fbdev/tmiofb.c
index 50111966c981..b70faa3850f2 100644
--- a/drivers/video/fbdev/tmiofb.c
+++ b/drivers/video/fbdev/tmiofb.c
@@ -802,10 +802,8 @@ static int tmiofb_remove(struct platform_device *dev)
const struct mfd_cell *cell = mfd_get_cell(dev);
struct fb_info *info = platform_get_drvdata(dev);
int irq = platform_get_irq(dev, 0);
-   struct tmiofb_par *par;
 
if (info) {
-   par = info->par;
unregister_framebuffer(info);
 
tmiofb_hw_stop(dev);
@@ -816,8 +814,8 @@ static int tmiofb_remove(struct platform_device *dev)
free_irq(irq, info);
 
iounmap(info->screen_base);
-   iounmap(par->lcr);
-   iounmap(par->ccr);
+   iounmap(((struct tmiofb_par *)info->par)->lcr);
+   iounmap(((struct tmiofb_par *)info->par)->ccr);
 
framebuffer_release(info);
}
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 22/28] video: fbdev: omapfb: Fix W=1 warnings in dsi

2020-11-27 Thread Sam Ravnborg
Fix several W=1 warnings.
This removes a little unused code and avoids an assignment by moving
the use inside the conditional block.

Signed-off-by: Sam Ravnborg 
Cc: Aditya Pakki 
Cc: Sam Ravnborg 
Cc: Bartlomiej Zolnierkiewicz 
---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c 
b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index 6f9c25fec994..72d45a02c3ac 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -1178,13 +1178,12 @@ static int dsi_regulator_init(struct platform_device 
*dsidev)
 
 static void _dsi_print_reset_status(struct platform_device *dsidev)
 {
-   u32 l;
int b0, b1, b2;
 
/* A dummy read using the SCP interface to any DSIPHY register is
 * required after DSIPHY reset to complete the reset of the DSI complex
 * I/O. */
-   l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
+   dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
 
if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) {
b0 = 28;
@@ -3627,7 +3626,7 @@ static int dsi_proto_config(struct platform_device 
*dsidev)
 static void dsi_proto_timings(struct platform_device *dsidev)
 {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail;
+   unsigned tlpx, tclk_zero, tclk_prepare;
unsigned tclk_pre, tclk_post;
unsigned ths_prepare, ths_prepare_ths_zero, ths_zero;
unsigned ths_trail, ths_exit;
@@ -3646,7 +3645,6 @@ static void dsi_proto_timings(struct platform_device 
*dsidev)
 
r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG1);
tlpx = FLD_GET(r, 20, 16) * 2;
-   tclk_trail = FLD_GET(r, 15, 8);
tclk_zero = FLD_GET(r, 7, 0);
 
r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG2);
@@ -4040,7 +4038,6 @@ static int dsi_update(struct omap_dss_device *dssdev, int 
channel,
 {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
-   u16 dw, dh;
 
dsi_perf_mark_setup(dsidev);
 
@@ -4049,11 +4046,8 @@ static int dsi_update(struct omap_dss_device *dssdev, 
int channel,
dsi->framedone_callback = callback;
dsi->framedone_data = data;
 
-   dw = dsi->timings.x_res;
-   dh = dsi->timings.y_res;
-
 #ifdef DSI_PERF_MEASURE
-   dsi->update_bytes = dw * dh *
+   dsi->update_bytes = dsi->timings.x_res * dsi->timings.y_res *
dsi_get_pixel_size(dsi->pix_fmt) / 8;
 #endif
dsi_update_screen_dispc(dsidev);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 28/28] video: fbdev: s1d13xxxfb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix following W=1 warnings:
- Fix unused variables for variables used only for logging.
  Fixed by introducing no_printk() to trick compiler to think variables
  are used
- Fix kernel-doc warning by deleting an empty comment line

Signed-off-by: Sam Ravnborg 
Cc: Kristoffer Ericson 
---
 drivers/video/fbdev/s1d13xxxfb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
index 4541afcf9386..d1b5f965bc96 100644
--- a/drivers/video/fbdev/s1d13xxxfb.c
+++ b/drivers/video/fbdev/s1d13xxxfb.c
@@ -45,7 +45,7 @@
 #if 0
 #define dbg(fmt, args...) do { printk(KERN_INFO fmt, ## args); } while(0)
 #else
-#define dbg(fmt, args...) do { } while (0)
+#define dbg(fmt, args...) do { no_printk(KERN_INFO fmt, ## args); } while (0)
 #endif
 
 /*
@@ -512,7 +512,6 @@ s1d13xxxfb_bitblt_copyarea(struct fb_info *info, const 
struct fb_copyarea *area)
 }
 
 /**
- *
  * s1d13xxxfb_bitblt_solidfill - accelerated solidfill function
  * @info : framebuffer structure
  * @rect : fb_fillrect structure
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 27/28] video: fbdev: cirrusfb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix warnings:
- fix kernel-doc
- delete unused code

Signed-off-by: Sam Ravnborg 
Cc: Thomas Zimemrmann 
Cc: Sam Ravnborg 
Cc: "Gustavo A. R. Silva" 
Cc: Daniel Vetter 
Cc: Saeed Mirzamohammadi 
Cc: Jani Nikula 
Cc: Mike Rapoport 
---
 drivers/video/fbdev/cirrusfb.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c
index e9027172c0f5..93802abbbc72 100644
--- a/drivers/video/fbdev/cirrusfb.c
+++ b/drivers/video/fbdev/cirrusfb.c
@@ -2463,8 +2463,6 @@ static void AttrOn(const struct cirrusfb_info *cinfo)
  */
 static void WHDR(const struct cirrusfb_info *cinfo, unsigned char val)
 {
-   unsigned char dummy;
-
if (is_laguna(cinfo))
return;
if (cinfo->btype == BT_PICASSO) {
@@ -2473,18 +2471,18 @@ static void WHDR(const struct cirrusfb_info *cinfo, 
unsigned char val)
WGen(cinfo, VGA_PEL_MSK, 0x00);
udelay(200);
/* next read dummy from pixel address (3c8) */
-   dummy = RGen(cinfo, VGA_PEL_IW);
+   RGen(cinfo, VGA_PEL_IW);
udelay(200);
}
/* now do the usual stuff to access the HDR */
 
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
-   dummy = RGen(cinfo, VGA_PEL_MSK);
+   RGen(cinfo, VGA_PEL_MSK);
udelay(200);
 
WGen(cinfo, VGA_PEL_MSK, val);
@@ -2492,7 +2490,7 @@ static void WHDR(const struct cirrusfb_info *cinfo, 
unsigned char val)
 
if (cinfo->btype == BT_PICASSO) {
/* now first reset HDR access counter */
-   dummy = RGen(cinfo, VGA_PEL_IW);
+   RGen(cinfo, VGA_PEL_IW);
udelay(200);
 
/* and at the end, restore the mask value */
@@ -2800,9 +2798,9 @@ static void bestclock(long freq, int *nom, int *den, int 
*div)
 
 #ifdef CIRRUSFB_DEBUG
 
-/**
+/*
  * cirrusfb_dbg_print_regs
- * @base: If using newmmio, the newmmio base address, otherwise %NULL
+ * @regbase: If using newmmio, the newmmio base address, otherwise %NULL
  * @reg_class: type of registers to read: %CRT, or %SEQ
  *
  * DESCRIPTION:
@@ -2847,7 +2845,7 @@ static void cirrusfb_dbg_print_regs(struct fb_info *info,
va_end(list);
 }
 
-/**
+/*
  * cirrusfb_dbg_reg_dump
  * @base: If using newmmio, the newmmio base address, otherwise %NULL
  *
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 24/28] video: fbdev: s3c-fb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix several W=1 warnings
- Updated kernel-doc as needed
- Deleted unused local variable, it was assigned but never used

Signed-off-by: Sam Ravnborg 
Cc: Jingoo Han 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/s3c-fb.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index ba316bd56efd..3b134e1bbc38 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -75,6 +75,7 @@ struct s3c_fb;
  * @buf_size: Offset of buffer size registers.
  * @buf_end: Offset of buffer end registers.
  * @osd: The base for the OSD registers.
+ * @osd_stride: stride of osd
  * @palette: Address of palette memory, or 0 if none.
  * @has_prtcon: Set if has PRTCON register.
  * @has_shadowcon: Set if has SHADOWCON register.
@@ -155,7 +156,7 @@ struct s3c_fb_palette {
  * @windata: The platform data supplied for the window configuration.
  * @parent: The hardware that this window is part of.
  * @fbinfo: Pointer pack to the framebuffer info for this window.
- * @varint: The variant information for this window.
+ * @variant: The variant information for this window.
  * @palette_buffer: Buffer/cache to hold palette entries.
  * @pseudo_palette: For use in TRUECOLOUR modes for entries 0..15/
  * @index: The window number of this window.
@@ -336,7 +337,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
 /**
  * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock.
  * @sfb: The hardware state.
- * @pixclock: The pixel clock wanted, in picoseconds.
+ * @pixclk: The pixel clock wanted, in picoseconds.
  *
  * Given the specified pixel clock, work out the necessary divider to get
  * close to the output frequency.
@@ -733,7 +734,7 @@ static inline unsigned int chan_to_field(unsigned int chan,
  * @red: The red field for the palette data.
  * @green: The green field for the palette data.
  * @blue: The blue field for the palette data.
- * @trans: The transparency (alpha) field for the palette data.
+ * @transp: The transparency (alpha) field for the palette data.
  * @info: The framebuffer being changed.
  */
 static int s3c_fb_setcolreg(unsigned regno,
@@ -1133,6 +1134,7 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct 
s3c_fb_win *win)
 
 /**
  * s3c_fb_release_win() - release resources for a framebuffer window.
+ * @sfb: The base resources for the hardware.
  * @win: The window to cleanup the resources for.
  *
  * Release the resources that where claimed for the hardware window,
@@ -1160,6 +1162,7 @@ static void s3c_fb_release_win(struct s3c_fb *sfb, struct 
s3c_fb_win *win)
 /**
  * s3c_fb_probe_win() - register an hardware window
  * @sfb: The base resources for the hardware
+ * @win_no: The window number
  * @variant: The variant information for this window.
  * @res: Pointer to where to place the resultant window.
  *
@@ -1170,7 +1173,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned 
int win_no,
struct s3c_fb_win_variant *variant,
struct s3c_fb_win **res)
 {
-   struct fb_var_screeninfo *var;
struct fb_videomode initmode;
struct s3c_fb_pd_win *windata;
struct s3c_fb_win *win;
@@ -1198,7 +1200,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned 
int win_no,
 
win = fbinfo->par;
*res = win;
-   var = >var;
win->variant = *variant;
win->fbinfo = fbinfo;
win->parent = sfb;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 25/28] video: fbdev: uvesafb: Fix W=1 warning

2020-11-27 Thread Sam Ravnborg
Fix W=1 warning by deleting unused local variable.

Signed-off-by: Sam Ravnborg 
Cc: Michal Januszewski 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/uvesafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index def14ac0ebe1..8ee0fc9c63cf 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -554,12 +554,12 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask 
*task,
 static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
  struct uvesafb_par *par)
 {
-   int i, err;
+   int i;
 
uvesafb_reset(task);
task->t.regs.eax = 0x4f0a;
task->t.regs.ebx = 0x0;
-   err = uvesafb_exec(task);
+   uvesafb_exec(task);
 
if ((task->t.regs.eax & 0x) != 0x4f || task->t.regs.es < 0xc000) {
par->pmi_setpal = par->ypan = 0;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 23/28] video: fbdev: omapfb: Fix W=1 warnings in hdmi*_core

2020-11-27 Thread Sam Ravnborg
Fix a few W=1 warnings about unused assignments.
Drop the unused error code.

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Qilong Zhang 
Cc: "Alexander A. Klimov" 
Cc: Daniel Vetter 
---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c | 4 ++--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c 
b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
index 726c190862d4..e6363a420933 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
@@ -679,7 +679,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
struct hdmi_audio_format audio_format;
struct hdmi_audio_dma audio_dma;
struct hdmi_core_audio_config acore;
-   int err, n, cts, channel_count;
+   int n, cts, channel_count;
unsigned int fs_nr;
bool word_length_16b = false;
 
@@ -741,7 +741,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
return -EINVAL;
}
 
-   err = hdmi_compute_acr(pclk, fs_nr, , );
+   hdmi_compute_acr(pclk, fs_nr, , );
 
/* Audio clock regeneration settings */
acore.n = n;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c 
b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
index eda29d3032e1..cb63bc0e92ca 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
@@ -790,7 +790,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
struct hdmi_audio_format audio_format;
struct hdmi_audio_dma audio_dma;
struct hdmi_core_audio_config core_cfg;
-   int err, n, cts, channel_count;
+   int n, cts, channel_count;
unsigned int fs_nr;
bool word_length_16b = false;
 
@@ -833,7 +833,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
return -EINVAL;
}
 
-   err = hdmi_compute_acr(pclk, fs_nr, , );
+   hdmi_compute_acr(pclk, fs_nr, , );
core_cfg.n = n;
core_cfg.cts = cts;
 
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 14/28] video: fbdev: pm2fb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fixed a few kernel-doc issues to fix the warnings.

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: "Gustavo A. R. Silva" 
Cc: Randy Dunlap 
Cc: Arnd Bergmann 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Jani Nikula 
---
 drivers/video/fbdev/pm2fb.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/pm2fb.c b/drivers/video/fbdev/pm2fb.c
index 27893fa139b0..c68725eebee3 100644
--- a/drivers/video/fbdev/pm2fb.c
+++ b/drivers/video/fbdev/pm2fb.c
@@ -1508,8 +1508,8 @@ static const struct fb_ops pm2fb_ops = {
  *
  * Initialise and allocate resource for PCI device.
  *
- * @param  pdevPCI device.
- * @param  id  PCI device ID.
+ * @pdev:  PCI device.
+ * @id:PCI device ID.
  */
 static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -1715,7 +1715,7 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
  *
  * Release all device resources.
  *
- * @param  pdevPCI device to clean up.
+ * @pdev:  PCI device to clean up.
  */
 static void pm2fb_remove(struct pci_dev *pdev)
 {
@@ -1756,7 +1756,7 @@ MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
 
 
 #ifndef MODULE
-/**
+/*
  * Parse user specified options.
  *
  * This is, comma-separated options following `video=pm2fb:'.
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 26/28] video: fbdev: uvesafb: Fix W=1 string related warnings

2020-11-27 Thread Sam Ravnborg
Two W=1 string related warnings.
- Using strncpy to copy string wihtout null-termination is not good.
  Use memcpy to copy only the relevant chars

- Fix a potential bug with a very long string, subtract one from the
  length to make room for the termination null.

Signed-off-by: Sam Ravnborg 
Cc: Michal Januszewski 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/uvesafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 8ee0fc9c63cf..45dc8da191e4 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -423,7 +423,7 @@ static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
task->t.flags = TF_VBEIB;
task->t.buf_len = sizeof(struct vbe_ib);
task->buf = >vbe_ib;
-   strncpy(par->vbe_ib.vbe_signature, "VBE2", 4);
+   memcpy(par->vbe_ib.vbe_signature, "VBE2", 4);
 
err = uvesafb_exec(task);
if (err || (task->t.regs.eax & 0x) != 0x004f) {
@@ -1871,7 +1871,7 @@ static ssize_t v86d_show(struct device_driver *dev, char 
*buf)
 static ssize_t v86d_store(struct device_driver *dev, const char *buf,
size_t count)
 {
-   strncpy(v86d_path, buf, PATH_MAX);
+   strncpy(v86d_path, buf, PATH_MAX - 1);
return count;
 }
 static DRIVER_ATTR_RW(v86d);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 17/28] video: fbdev: tgafb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Daniel Vetter 
Cc: Arnd Bergmann 
Cc: Joe Perches 
---
 drivers/video/fbdev/tgafb.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/tgafb.c b/drivers/video/fbdev/tgafb.c
index 666fbe2f671c..ae0cf5540636 100644
--- a/drivers/video/fbdev/tgafb.c
+++ b/drivers/video/fbdev/tgafb.c
@@ -555,7 +555,7 @@ tgafb_setcolreg(unsigned regno, unsigned red, unsigned 
green, unsigned blue,
 
 /**
  *  tgafb_blank - Optional function.  Blanks the display.
- *  @blank_mode: the blank mode we want.
+ *  @blank: the blank mode we want.
  *  @info: frame buffer structure that represents a single frame buffer
  */
 static int
@@ -837,7 +837,7 @@ tgafb_clut_imageblit(struct fb_info *info, const struct 
fb_image *image)
u32 *palette = ((u32 *)info->pseudo_palette);
unsigned long pos, line_length, i, j;
const unsigned char *data;
-   void __iomem *regs_base, *fb_base;
+   void __iomem *fb_base;
 
dx = image->dx;
dy = image->dy;
@@ -855,7 +855,6 @@ tgafb_clut_imageblit(struct fb_info *info, const struct 
fb_image *image)
if (dy + height > vyres)
height = vyres - dy;
 
-   regs_base = par->tga_regs_base;
fb_base = par->tga_fb_base;
 
pos = dy * line_length + (dx * 4);
@@ -1034,7 +1033,7 @@ tgafb_fillrect(struct fb_info *info, const struct 
fb_fillrect *rect)
 regs_base + TGA_MODE_REG);
 }
 
-/**
+/*
  *  tgafb_copyarea - REQUIRED function. Can use generic routines if
  *   non acclerated hardware and packed pixel based.
  *   Copies on area of the screen to another area.
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 19/28] video: fbdev: sstfb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings by introducing no_printk variants for the
internal logging system for this driver.

Fix a new warning that popped up now that logging was checked for
correct printf format strings.

A more invasive fix had been to replace all the internal logging with
standard logging primitives - thats for another day.

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Arnd Bergmann 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Alex Dewar 
Cc: Jani Nikula 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/sstfb.c | 2 +-
 include/video/sstfb.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/sstfb.c b/drivers/video/fbdev/sstfb.c
index c05cdabeb11c..27d4b0ace2d6 100644
--- a/drivers/video/fbdev/sstfb.c
+++ b/drivers/video/fbdev/sstfb.c
@@ -1390,7 +1390,7 @@ static int sstfb_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
fix->smem_start, info->screen_base,
fix->smem_len >> 20);
 
-   f_ddprintk("regbase_virt: %#lx\n", par->mmio_vbase);
+   f_ddprintk("regbase_virt: %p\n", par->mmio_vbase);
f_ddprintk("membase_phys: %#lx\n", fix->smem_start);
f_ddprintk("fbbase_virt: %p\n", info->screen_base);
 
diff --git a/include/video/sstfb.h b/include/video/sstfb.h
index 28384f354773..d4a5e41d1173 100644
--- a/include/video/sstfb.h
+++ b/include/video/sstfb.h
@@ -23,7 +23,7 @@
 #  define SST_DEBUG_FUNC 1
 #  define SST_DEBUG_VAR  1
 #else
-#  define dprintk(X...)
+#  define dprintk(X...)no_printk(X)
 #  define SST_DEBUG_REG  0
 #  define SST_DEBUG_FUNC 0
 #  define SST_DEBUG_VAR  0
@@ -48,7 +48,7 @@
 #if (SST_DEBUG_FUNC > 1)
 #  define f_ddprintk(X...) dprintk(" " X)
 #else
-#  define f_ddprintk(X...)
+#  define f_ddprintk(X...) no_printk(X)
 #endif
 #if (SST_DEBUG_FUNC > 2)
 #  define f_dddprintk(X...)dprintk(" " X)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 20/28] video: fbdev: nvidia: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix warnings by deleting unused code

Signed-off-by: Sam Ravnborg 
Cc: Antonino Daplas 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/nvidia/nv_setup.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_setup.c 
b/drivers/video/fbdev/nvidia/nv_setup.c
index 2fa68669613a..5404017e6957 100644
--- a/drivers/video/fbdev/nvidia/nv_setup.c
+++ b/drivers/video/fbdev/nvidia/nv_setup.c
@@ -89,9 +89,8 @@ u8 NVReadSeq(struct nvidia_par *par, u8 index)
 }
 void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
 {
-   volatile u8 tmp;
 
-   tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+   VGA_RD08(par->PCIO, par->IOBase + 0x0a);
if (par->paletteEnabled)
index &= ~0x20;
else
@@ -101,9 +100,7 @@ void NVWriteAttr(struct nvidia_par *par, u8 index, u8 value)
 }
 u8 NVReadAttr(struct nvidia_par *par, u8 index)
 {
-   volatile u8 tmp;
-
-   tmp = VGA_RD08(par->PCIO, par->IOBase + 0x0a);
+   VGA_RD08(par->PCIO, par->IOBase + 0x0a);
if (par->paletteEnabled)
index &= ~0x20;
else
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 15/28] video: fbdev: neofb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnigns by removing unused code

Signed-off-by: Sam Ravnborg 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Andrew Morton 
Cc: Evgeny Novikov 
Cc: Jani Nikula 
Cc: Mike Rapoport 
---
 drivers/video/fbdev/neofb.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c
index 09a20d4ab35f..c0f4f402da3f 100644
--- a/drivers/video/fbdev/neofb.c
+++ b/drivers/video/fbdev/neofb.c
@@ -1843,7 +1843,6 @@ static int neo_init_hw(struct fb_info *info)
struct neofb_par *par = info->par;
int videoRam = 896;
int maxClock = 65000;
-   int CursorMem = 1024;
int CursorOff = 0x100;
 
DBG("neo_init_hw");
@@ -1895,19 +1894,16 @@ static int neo_init_hw(struct fb_info *info)
case FB_ACCEL_NEOMAGIC_NM2070:
case FB_ACCEL_NEOMAGIC_NM2090:
case FB_ACCEL_NEOMAGIC_NM2093:
-   CursorMem = 2048;
CursorOff = 0x100;
break;
case FB_ACCEL_NEOMAGIC_NM2097:
case FB_ACCEL_NEOMAGIC_NM2160:
-   CursorMem = 1024;
CursorOff = 0x100;
break;
case FB_ACCEL_NEOMAGIC_NM2200:
case FB_ACCEL_NEOMAGIC_NM2230:
case FB_ACCEL_NEOMAGIC_NM2360:
case FB_ACCEL_NEOMAGIC_NM2380:
-   CursorMem = 1024;
CursorOff = 0x1000;
 
par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 18/28] video: fbdev: mx3fb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused code/variables

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Laurent Pinchart 
Cc: Daniel Vetter 
Cc: Xiaofei Tan 
Cc: Arnd Bergmann 
---
 drivers/video/fbdev/mx3fb.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 894617ddabcb..fabb271337ed 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -445,7 +445,6 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 {
struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
-   uint32_t enabled;
unsigned long flags;
 
if (mx3_fbi->txd == NULL)
@@ -453,7 +452,7 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
 
spin_lock_irqsave(>lock, flags);
 
-   enabled = sdc_fb_uninit(mx3_fbi);
+   sdc_fb_uninit(mx3_fbi);
 
spin_unlock_irqrestore(>lock, flags);
 
@@ -732,7 +731,7 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi);
 
 /**
  * mx3fb_set_fix() - set fixed framebuffer parameters from variable settings.
- * @info:  framebuffer information pointer
+ * @fbi:   framebuffer information pointer
  * @return:0 on success or negative error code on failure.
  */
 static int mx3fb_set_fix(struct fb_info *fbi)
@@ -740,7 +739,7 @@ static int mx3fb_set_fix(struct fb_info *fbi)
struct fb_fix_screeninfo *fix = >fix;
struct fb_var_screeninfo *var = >var;
 
-   strncpy(fix->id, "DISP3 BG", 8);
+   memcpy(fix->id, "DISP3 BG", 8);
 
fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
 
@@ -1105,6 +1104,8 @@ static void __blank(int blank, struct fb_info *fbi)
 
 /**
  * mx3fb_blank() - blank the display.
+ * @blank: blank value for the panel
+ * @fbi:   framebuffer information pointer
  */
 static int mx3fb_blank(int blank, struct fb_info *fbi)
 {
@@ -1126,7 +1127,7 @@ static int mx3fb_blank(int blank, struct fb_info *fbi)
 /**
  * mx3fb_pan_display() - pan or wrap the display
  * @var:   variable screen buffer information.
- * @info:  framebuffer information pointer.
+ * @fbi:   framebuffer information pointer.
  *
  * We look only at xoffset, yoffset and the FB_VMODE_YWRAP flag
  */
@@ -1387,6 +1388,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi)
 
 /**
  * mx3fb_init_fbinfo() - initialize framebuffer information object.
+ * @dev: the device
+ * @ops:   framebuffer device operations
  * @return:initialized framebuffer structure.
  */
 static struct fb_info *mx3fb_init_fbinfo(struct device *dev,
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 13/28] video: fbdev: riva: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings:
- Fix kernel-doc
- Drop unused variables/code

Signed-off-by: Sam Ravnborg 
Cc: Antonino Daplas 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/riva/fbdev.c   |  9 -
 drivers/video/fbdev/riva/riva_hw.c | 28 
 2 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index ce55b9d2e862..4b0433cb 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -464,7 +464,7 @@ static inline void reverse_order(u32 *l)
 
 /**
  * rivafb_load_cursor_image - load cursor image to hardware
- * @data: address to monochrome bitmap (1 = foreground color, 0 = background)
+ * @data8: address to monochrome bitmap (1 = foreground color, 0 = background)
  * @par:  pointer to private data
  * @w:width of cursor image in pixels
  * @h:height of cursor image in scanlines
@@ -843,9 +843,9 @@ static void riva_update_var(struct fb_var_screeninfo *var,
 /**
  * rivafb_do_maximize - 
  * @info: pointer to fb_info object containing info for current riva board
- * @var:
- * @nom:
- * @den:
+ * @var: standard kernel fb changeable data
+ * @nom: nom
+ * @den: den
  *
  * DESCRIPTION:
  * .
@@ -1214,7 +1214,6 @@ static int rivafb_set_par(struct fb_info *info)
 /**
  * rivafb_pan_display
  * @var: standard kernel fb changeable data
- * @con: TODO
  * @info: pointer to fb_info object containing info for current riva board
  *
  * DESCRIPTION:
diff --git a/drivers/video/fbdev/riva/riva_hw.c 
b/drivers/video/fbdev/riva/riva_hw.c
index bcf9c4b4de31..8b829b720064 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -836,17 +836,17 @@ static void nv10CalcArbitration
 nv10_sim_state *arb
 )
 {
-int data, pagemiss, cas,width, video_enable, bpp;
-int nvclks, mclks, pclks, vpagemiss, crtpagemiss, vbs;
-int nvclk_fill, us_extra;
+int data, pagemiss, width, video_enable, bpp;
+int nvclks, mclks, pclks, vpagemiss, crtpagemiss;
+int nvclk_fill;
 int found, mclk_extra, mclk_loop, cbs, m1;
 int mclk_freq, pclk_freq, nvclk_freq, mp_enable;
-int us_m, us_m_min, us_n, us_p, video_drain_rate, crtc_drain_rate;
-int vus_m, vus_n, vus_p;
-int vpm_us, us_video, vlwm, cpm_us, us_crt,clwm;
+int us_m, us_m_min, us_n, us_p, crtc_drain_rate;
+int vus_m;
+int vpm_us, us_video, cpm_us, us_crt,clwm;
 int clwm_rnd_down;
-int craw, m2us, us_pipe, us_pipe_min, vus_pipe, p1clk, p2;
-int pclks_2_top_fifo, min_mclk_extra;
+int m2us, us_pipe_min, p1clk, p2;
+int min_mclk_extra;
 int us_min_mclk_extra;
 
 fifo->valid = 1;
@@ -854,16 +854,13 @@ static void nv10CalcArbitration
 mclk_freq = arb->mclk_khz;
 nvclk_freq = arb->nvclk_khz;
 pagemiss = arb->mem_page_miss;
-cas = arb->mem_latency;
 width = arb->memory_width/64;
 video_enable = arb->enable_video;
 bpp = arb->pix_bpp;
 mp_enable = arb->enable_mp;
 clwm = 0;
-vlwm = 1024;
 
 cbs = 512;
-vbs = 512;
 
 pclks = 4; /* lwm detect. */
 
@@ -924,17 +921,11 @@ static void nv10CalcArbitration
   us_min_mclk_extra = min_mclk_extra *1000*1000 / mclk_freq;
   us_n = nvclks*1000*1000 / nvclk_freq;/* nvclk latency in us */
   us_p = pclks*1000*1000 / pclk_freq;/* nvclk latency in us */
-  us_pipe = us_m + us_n + us_p;
   us_pipe_min = us_m_min + us_n + us_p;
-  us_extra = 0;
 
   vus_m = mclk_loop *1000*1000 / mclk_freq; /* Mclk latency in us */
-  vus_n = (4)*1000*1000 / nvclk_freq;/* nvclk latency in us */
-  vus_p = 0*1000*1000 / pclk_freq;/* pclk latency in us */
-  vus_pipe = vus_m + vus_n + vus_p;
 
   if(video_enable) {
-video_drain_rate = pclk_freq * 4; /* MB/s */
 crtc_drain_rate = pclk_freq * bpp/8; /* MB/s */
 
 vpagemiss = 1; /* self generating page miss */
@@ -993,7 +984,6 @@ static void nv10CalcArbitration
   else if(crtc_drain_rate * 100  >= nvclk_fill * 98) {
   clwm = 1024;
   cbs = 512;
-  us_extra = (cbs * 1000 * 1000)/ (8*width)/mclk_freq ;
   }
   }
   }
@@ -1010,7 +1000,6 @@ static void nv10CalcArbitration
 
   m1 = clwm + cbs -  1024; /* Amount of overfill */
   m2us = us_pipe_min + us_min_mclk_extra;
-  pclks_2_top_fifo = (1024-clwm)/(8*width);
 
   /* pclk cycles to drain */
   p1clk = m2us * pclk_freq/(1000*1000); 
@@ -1038,7 +1027,6 @@ static void nv10CalcArbitration
   min_mclk_extra--;
 }
   }
-  craw = clwm;
 
   if(clwm < (1024-cbs+8)) clwm = 1024-cbs+8;
   data = (int)(clwm);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 16/28] video: fbdev: hgafb: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix kernel-doc comments.

Signed-off-by: Sam Ravnborg 
Cc: Ferenc Bakonyi 
Cc: linux-nvi...@lists.surfsouth.com
---
 drivers/video/fbdev/hgafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
index a45fcff1461f..69af72937844 100644
--- a/drivers/video/fbdev/hgafb.c
+++ b/drivers/video/fbdev/hgafb.c
@@ -358,7 +358,7 @@ static int hga_card_detect(void)
 /**
  * hgafb_open - open the framebuffer device
  * @info:pointer to fb_info object containing info for current hga board
- * @int:open by console system or userland.
+ * @init:open by console system or userland.
  */
 
 static int hgafb_open(struct fb_info *info, int init)
@@ -372,7 +372,7 @@ static int hgafb_open(struct fb_info *info, int init)
 /**
  * hgafb_open - open the framebuffer device
  * @info:pointer to fb_info object containing info for current hga board
- * @int:open by console system or userland.
+ * @init:open by console system or userland.
  */
 
 static int hgafb_release(struct fb_info *info, int init)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 08/28] video: fbdev: sis: Fix W=1 warning about SiS_TVDelay

2020-11-27 Thread Sam Ravnborg
Fix W=1 warning by commenting unused SiS_TVDelay* variables.

The SiS_TVDelay* variables seem to contain some magic numbers
so looks like data worth keeping around but not as code we build.

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
---
 drivers/video/fbdev/sis/oem310.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/sis/oem310.h b/drivers/video/fbdev/sis/oem310.h
index 8fce56e4482c..ed28755715ce 100644
--- a/drivers/video/fbdev/sis/oem310.h
+++ b/drivers/video/fbdev/sis/oem310.h
@@ -200,6 +200,7 @@ static const unsigned char 
SiS310_TVDelayCompensation_651302LV[] =  /* M650, 651,
0x33,0x33
 };
 
+#if 0 /* Not used */
 static const unsigned char SiS_TVDelay661_301[] =  /* 661, 
301 */
 {
0x44,0x44,
@@ -219,6 +220,7 @@ static const unsigned char SiS_TVDelay661_301B[] =  
/* 661, 301B et al */
0x44,0x44,
0x44,0x44
 };
+#endif
 
 static const unsigned char SiS310_TVDelayCompensation_LVDS[] = /* LVDS 
*/
 {
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 11/28] video: fbdev: via: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings about unused assignment.
Fixed by dropping the assignment and deleting the local variable.

Signed-off-by: Sam Ravnborg 
Cc: Florian Tobias Schandinat 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/via/lcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/via/lcd.c b/drivers/video/fbdev/via/lcd.c
index 4a869402d120..088b962076b5 100644
--- a/drivers/video/fbdev/via/lcd.c
+++ b/drivers/video/fbdev/via/lcd.c
@@ -537,11 +537,9 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo 
*var, u16 cxres,
u32 clock;
struct via_display_timing timing;
struct fb_var_screeninfo panel_var;
-   const struct fb_videomode *mode_crt_table, *panel_crt_table;
+   const struct fb_videomode *panel_crt_table;
 
DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n");
-   /* Get mode table */
-   mode_crt_table = viafb_get_best_mode(set_hres, set_vres, 60);
/* Get panel table Pointer */
panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);
viafb_fill_var_timing_info(_var, panel_crt_table);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 12/28] video: fbdev: tdfx: Fix W=1 warnings

2020-11-27 Thread Sam Ravnborg
Fix W=1 warning about unused assignment.
Fix by dropping the local variable.

Signed-off-by: Sam Ravnborg 
Cc: "Gustavo A. R. Silva" 
Cc: Sam Ravnborg 
Cc: Jani Nikula 
Cc: Daniel Vetter 
Cc: Arnd Bergmann 
---
 drivers/video/fbdev/tdfxfb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c
index f056d80f6359..67e37a62b07c 100644
--- a/drivers/video/fbdev/tdfxfb.c
+++ b/drivers/video/fbdev/tdfxfb.c
@@ -206,9 +206,7 @@ static inline u8 crt_inb(struct tdfx_par *par, u32 idx)
 
 static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val)
 {
-   unsigned char tmp;
-
-   tmp = vga_inb(par, IS1_R);
+   vga_inb(par, IS1_R);
vga_outb(par, ATT_IW, idx);
vga_outb(par, ATT_IW, val);
 }
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 07/28] video: fbdev: sis: Fix W=1 warnings about static symbols

2020-11-27 Thread Sam Ravnborg
init.h define static symbols, so should only be included
once. Drop the include from sis.h as it is not needed.
This fixes a lot of warnings seen with a W=1 build.

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
---
 drivers/video/fbdev/sis/sis.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/sis/sis.h b/drivers/video/fbdev/sis/sis.h
index 9f4c3093ccb3..d632f096083b 100644
--- a/drivers/video/fbdev/sis/sis.h
+++ b/drivers/video/fbdev/sis/sis.h
@@ -15,7 +15,6 @@
 
 #include "vgatypes.h"
 #include "vstruct.h"
-#include "init.h"
 
 #define VER_MAJOR  1
 #define VER_MINOR  8
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 09/28] video: fbdev: sis: Fix W=1 warnings in init.c

2020-11-27 Thread Sam Ravnborg
Fix several W=1 warnings.
This removes a lot of unused code - which is always a good thing to do.

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
---
 drivers/video/fbdev/sis/init.c | 34 ++
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
index fde27feae5d0..b77ea1a8825a 100644
--- a/drivers/video/fbdev/sis/init.c
+++ b/drivers/video/fbdev/sis/init.c
@@ -2648,7 +2648,7 @@ static void
 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
unsigned short ModeIdIndex, unsigned short RRTI)
 {
-   unsigned short data, infoflag = 0, modeflag, resindex;
+   unsigned short data, infoflag = 0, modeflag;
 #ifdef CONFIG_FB_SIS_315
unsigned char  *ROMAddr  = SiS_Pr->VirtualRomBase;
unsigned short data2, data3;
@@ -2659,7 +2659,7 @@ SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned 
short ModeNo,
if(SiS_Pr->UseCustomMode) {
   infoflag = SiS_Pr->CInfoFlag;
} else {
-  resindex = SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
+  SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
   if(ModeNo > 0x13) {
 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
   }
@@ -3538,17 +3538,13 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
struct fb_var_screeninfo *var, bool writeres
 )
 {
-   unsigned short HRE, HBE, HRS, HBS, HDE, HT;
-   unsigned short VRE, VBE, VRS, VBS, VDE, VT;
-   unsigned char  sr_data, cr_data, cr_data2;
-   intA, B, C, D, E, F, temp;
+   unsigned short HRE, HBE, HRS, HDE;
+   unsigned short VRE, VBE, VRS, VDE;
+   unsigned char  sr_data, cr_data;
+   intB, C, D, E, F, temp;
 
sr_data = crdata[14];
 
-   /* Horizontal total */
-   HT =  crdata[0] | ((unsigned short)(sr_data & 0x03) << 8);
-   A = HT + 5;
-
/* Horizontal display enable end */
HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6);
E = HDE + 1;
@@ -3557,9 +3553,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2);
F = HRS - E - 3;
 
-   /* Horizontal blank start */
-   HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4);
-
sr_data = crdata[15];
cr_data = crdata[5];
 
@@ -3588,13 +3581,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
sr_data = crdata[13];
cr_data = crdata[7];
 
-   /* Vertical total */
-   VT  = crdata[6] |
-((unsigned short)(cr_data & 0x01) << 8) |
-((unsigned short)(cr_data & 0x20) << 4) |
-((unsigned short)(sr_data & 0x01) << 10);
-   A = VT + 2;
-
/* Vertical display enable end */
VDE = crdata[10] |
 ((unsigned short)(cr_data & 0x02) << 7) |
@@ -3609,14 +3595,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, 
unsigned char *crdata,
 ((unsigned short)(sr_data & 0x08) << 7);
F = VRS + 1 - E;
 
-   cr_data2 = (crdata[16] & 0x01) << 5;
-
-   /* Vertical blank start */
-   VBS = crdata[11] |
-((unsigned short)(cr_data  & 0x08) << 5) |
-((unsigned short)(cr_data2 & 0x20) << 4) |
-((unsigned short)(sr_data  & 0x04) << 8);
-
/* Vertical blank end */
VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4);
temp = VBE - ((E - 1) & 511);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 10/28] video: fbdev: sis: Fix W=1 warnings in sis_main

2020-11-27 Thread Sam Ravnborg
Fix W=1 warning by dropping unused variable

Signed-off-by: Sam Ravnborg 
Cc: Thomas Winischhofer 
---
 drivers/video/fbdev/sis/sis_main.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/sis/sis_main.c 
b/drivers/video/fbdev/sis/sis_main.c
index 03c736f6f3d0..266a5582f94d 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -5029,7 +5029,6 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info 
*ivideo, u8 regb)
static const u8 cs168[8] = {
0x48, 0x78, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00
};
-   u8 reg;
u8 v1;
u8 v2;
u8 v3;
@@ -5037,9 +5036,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info 
*ivideo, u8 regb)
SiS_SetReg(SISCR, 0xb0, 0x80); /* DDR2 dual frequency mode */
SiS_SetReg(SISCR, 0x82, 0x77);
SiS_SetReg(SISCR, 0x86, 0x00);
-   reg = SiS_GetReg(SISCR, 0x86);
+   SiS_GetReg(SISCR, 0x86);
SiS_SetReg(SISCR, 0x86, 0x88);
-   reg = SiS_GetReg(SISCR, 0x86);
+   SiS_GetReg(SISCR, 0x86);
v1 = cs168[regb]; v2 = cs160[regb]; v3 = cs158[regb];
if (ivideo->haveXGIROM) {
v1 = bios[regb + 0x168];
@@ -5049,9 +5048,9 @@ static void sisfb_post_xgi_ddr2(struct sis_video_info 
*ivideo, u8 regb)
SiS_SetReg(SISCR, 0x86, v1);
SiS_SetReg(SISCR, 0x82, 0x77);
SiS_SetReg(SISCR, 0x85, 0x00);
-   reg = SiS_GetReg(SISCR, 0x85);
+   SiS_GetReg(SISCR, 0x85);
SiS_SetReg(SISCR, 0x85, 0x88);
-   reg = SiS_GetReg(SISCR, 0x85);
+   SiS_GetReg(SISCR, 0x85);
SiS_SetReg(SISCR, 0x85, v2);
SiS_SetReg(SISCR, 0x82, v3);
SiS_SetReg(SISCR, 0x98, 0x01);
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 06/28] video: fbdev: aty: Fix W=1 warnings in mach64_ct

2020-11-27 Thread Sam Ravnborg
Fix W=1 about variables assigned but never used.
- One variable is only used when CONFIG_FB_ATY_GENERIC_LCD is defined
  Fix so variable is only defined with CONFIG_FB_ATY_GENERIC_LCD
- Several variables was only assigned by a call to aty_ld_le32().
  Drop the variables but keep the call to aty_ld_le32() as it may
  have unexpected side-effects.

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
---
 drivers/video/fbdev/aty/mach64_ct.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/aty/mach64_ct.c 
b/drivers/video/fbdev/aty/mach64_ct.c
index f87cc81f4fa2..011b07e44e0d 100644
--- a/drivers/video/fbdev/aty/mach64_ct.c
+++ b/drivers/video/fbdev/aty/mach64_ct.c
@@ -281,10 +281,13 @@ static u32 aty_pll_to_var_ct(const struct fb_info *info, 
const union aty_pll *pl
 void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll)
 {
struct atyfb_par *par = (struct atyfb_par *) info->par;
-   u32 crtc_gen_cntl, lcd_gen_cntrl;
+   u32 crtc_gen_cntl;
u8 tmp, tmp2;
 
-   lcd_gen_cntrl = 0;
+#ifdef CONFIG_FB_ATY_GENERIC_LCD
+   u32 lcd_gen_cntrl = 0;
+#endif
+
 #ifdef DEBUG
printk("atyfb(%s): about to program:\n"
"pll_ext_cntl=0x%02x pll_gen_cntl=0x%02x 
pll_vclk_cntl=0x%02x\n",
@@ -402,7 +405,7 @@ static int aty_init_pll_ct(const struct fb_info *info, 
union aty_pll *pll)
struct atyfb_par *par = (struct atyfb_par *) info->par;
u8 mpost_div, xpost_div, sclk_post_div_real;
u32 q, memcntl, trp;
-   u32 dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off;
+   u32 dsp_config;
 #ifdef DEBUG
int pllmclk, pllsclk;
 #endif
@@ -488,9 +491,9 @@ static int aty_init_pll_ct(const struct fb_info *info, 
union aty_pll *pll)
 
/* Allow BIOS to override */
dsp_config = aty_ld_le32(DSP_CONFIG, par);
-   dsp_on_off = aty_ld_le32(DSP_ON_OFF, par);
-   vga_dsp_config = aty_ld_le32(VGA_DSP_CONFIG, par);
-   vga_dsp_on_off = aty_ld_le32(VGA_DSP_ON_OFF, par);
+   aty_ld_le32(DSP_ON_OFF, par);
+   aty_ld_le32(VGA_DSP_CONFIG, par);
+   aty_ld_le32(VGA_DSP_ON_OFF, par);
 
if (dsp_config)
pll->ct.dsp_loop_latency = (dsp_config & DSP_LOOP_LATENCY) >> 
16;
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 05/28] video: fbdev: aty: Fix W=1 warnings in atyfb_base

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings about variables assigned but never used.

- Drop variables that was never used
- Avoid using a local variable by moving the expression to an if
  condition

Signed-off-by: Sam Ravnborg 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Daniel Vetter 
Cc: Joe Perches 
Cc: Vaibhav Gupta 
Cc: Jason Yan 
Cc: Randy Dunlap 
Cc: Jani Nikula 
---
 drivers/video/fbdev/aty/atyfb_base.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c 
b/drivers/video/fbdev/aty/atyfb_base.c
index c8feff0ee8da..d1eb9218debb 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -2360,22 +2360,20 @@ static int aty_init(struct fb_info *info)
 #ifdef CONFIG_FB_ATY_GX
if (!M64_HAS(INTEGRATED)) {
u32 stat0;
-   u8 dac_type, dac_subtype, clk_type;
+   u8 dac_subtype, clk_type;
stat0 = aty_ld_le32(CNFG_STAT0, par);
par->bus_type = (stat0 >> 0) & 0x07;
par->ram_type = (stat0 >> 3) & 0x07;
ramname = aty_gx_ram[par->ram_type];
/* FIXME: clockchip/RAMDAC probing? */
-   dac_type = (aty_ld_le32(DAC_CNTL, par) >> 16) & 0x07;
+   aty_ld_le32(DAC_CNTL, par);
 #ifdef CONFIG_ATARI
clk_type = CLK_ATI18818_1;
-   dac_type = (stat0 >> 9) & 0x07;
-   if (dac_type == 0x07)
+   if (((stat0 >> 9) & 0x07) == 0x07)
dac_subtype = DAC_ATT20C408;
else
dac_subtype = (aty_ld_8(SCRATCH_REG1 + 1, par) & 0xF0) 
| dac_type;
 #else
-   dac_type = DAC_IBMRGB514;
dac_subtype = DAC_IBMRGB514;
clk_type = CLK_IBMRGB514;
 #endif
@@ -3062,7 +3060,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct 
fb_info *info,
if (dp == of_console_device) {
struct fb_var_screeninfo *var = _var;
unsigned int N, P, Q, M, T, R;
-   u32 v_total, h_total;
struct crtc crtc;
u8 pll_regs[16];
u8 clock_cntl;
@@ -3078,9 +3075,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct 
fb_info *info,
crtc.gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par);
aty_crtc_to_var(, var);
 
-   h_total = var->xres + var->right_margin + var->hsync_len + 
var->left_margin;
-   v_total = var->yres + var->lower_margin + var->vsync_len + 
var->upper_margin;
-
/*
 * Read the PLL to figure actual Refresh Rate.
 */
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 04/28] video: fbdev: aty: Delete unused variable in radeon_monitor

2020-11-27 Thread Sam Ravnborg
Fix W=1 about variable that is asssigned a value but never used.
The variable was indeed never used so delete it.

Keep the call to radeon_probe_i2c_connector() as it may have
side-effects. It is unlikely but I could not verify that is was safe to
drop the call.

Signed-off-by: Sam Ravnborg 
Cc: Benjamin Herrenschmidt 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/fbdev/aty/radeon_monitor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_monitor.c 
b/drivers/video/fbdev/aty/radeon_monitor.c
index 9966c58aa26c..df55e23b7a5a 100644
--- a/drivers/video/fbdev/aty/radeon_monitor.c
+++ b/drivers/video/fbdev/aty/radeon_monitor.c
@@ -488,12 +488,10 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
 #if defined(DEBUG) && defined(CONFIG_FB_RADEON_I2C)
{
u8 *EDIDs[4] = { NULL, NULL, NULL, NULL };
-   int mon_types[4] = {MT_NONE, MT_NONE, MT_NONE, MT_NONE};
int i;
 
for (i = 0; i < 4; i++)
-   mon_types[i] = radeon_probe_i2c_connector(rinfo,
- i+1, 
[i]);
+   radeon_probe_i2c_connector(rinfo, i + 1, 
[i]);
}
 #endif /* DEBUG */
/*
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 03/28] video: fbdev: core: Fix W=1 warnings in fbmon + fb_notify

2020-11-27 Thread Sam Ravnborg
Fix W=1 warnings by updating kernel-doc to follow the correct syntax.

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: Randy Dunlap 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Daniel Vetter 
Cc: "Alexander A. Klimov" 
---
 drivers/video/fbdev/core/fb_notify.c | 3 ++-
 drivers/video/fbdev/core/fbmon.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_notify.c 
b/drivers/video/fbdev/core/fb_notify.c
index 74c2da528884..d85717b6e14a 100644
--- a/drivers/video/fbdev/core/fb_notify.c
+++ b/drivers/video/fbdev/core/fb_notify.c
@@ -38,7 +38,8 @@ EXPORT_SYMBOL(fb_unregister_client);
 
 /**
  * fb_notifier_call_chain - notify clients of fb_events
- *
+ * @val: value passed to callback
+ * @v: pointer passed to callback
  */
 int fb_notifier_call_chain(unsigned long val, void *v)
 {
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 1bf82dbc9e3c..b0e690f41025 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -605,6 +605,7 @@ static void get_detailed_timing(unsigned char *block,
  * fb_create_modedb - create video mode database
  * @edid: EDID data
  * @dbsize: database size
+ * @specs: monitor specifications, may be NULL
  *
  * RETURNS: struct fb_videomode, @dbsize contains length of database
  *
@@ -1100,7 +1101,6 @@ static u32 fb_get_hblank_by_hfreq(u32 hfreq, u32 xres)
  *2 * M
  *M = 300;
  *C = 30;
-
  */
 static u32 fb_get_hblank_by_dclk(u32 dclk, u32 xres)
 {
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 02/28] video: fbcon: Use pr_debug() in fbcon

2020-11-27 Thread Sam Ravnborg
Replacing DPRINTK() statements with pr_debug fixes
W=1 warnings.
And moves to a more standard logging setup at the same time.

Signed-off-by: Sam Ravnborg 
Cc: Greg Kroah-Hartman 
Cc: Daniel Vetter 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Sam Ravnborg 
Cc: Jiri Slaby 
Cc: Peilin Ye 
Cc: Tetsuo Handa 
Cc: George Kennedy 
Cc: Nathan Chancellor 
Cc: Peter Rosin 
---
 drivers/video/fbdev/core/fbcon.c | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bf61598bf1c3..2edf90f638f3 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -56,8 +56,6 @@
  *  more details.
  */
 
-#undef FBCONDEBUG
-
 #include 
 #include 
 #include 
@@ -82,12 +80,6 @@
 
 #include "fbcon.h"
 
-#ifdef FBCONDEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## 
args)
-#else
-#  define DPRINTK(fmt, args...)
-#endif
-
 /*
  * FIXME: Locking
  *
@@ -1015,9 +1007,9 @@ static const char *fbcon_startup(void)
rows /= vc->vc_font.height;
vc_resize(vc, cols, rows);
 
-   DPRINTK("mode:   %s\n", info->fix.id);
-   DPRINTK("visual: %d\n", info->fix.visual);
-   DPRINTK("res:%dx%d-%d\n", info->var.xres,
+   pr_debug("mode:   %s\n", info->fix.id);
+   pr_debug("visual: %d\n", info->fix.visual);
+   pr_debug("res:%dx%d-%d\n", info->var.xres,
info->var.yres,
info->var.bits_per_pixel);
 
@@ -2013,7 +2005,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
y_diff < 0 || y_diff > virt_fh) {
const struct fb_videomode *mode;
 
-   DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
+   pr_debug("attempting resize %ix%i\n", var.xres, var.yres);
mode = fb_find_best_mode(, >modelist);
if (mode == NULL)
return -EINVAL;
@@ -2023,7 +2015,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int 
width,
if (virt_w > var.xres/virt_fw || virt_h > var.yres/virt_fh)
return -EINVAL;
 
-   DPRINTK("resize now %ix%i\n", var.xres, var.yres);
+   pr_debug("resize now %ix%i\n", var.xres, var.yres);
if (con_is_visible(vc)) {
var.activate = FB_ACTIVATE_NOW |
FB_ACTIVATE_FORCE;
@@ -3299,7 +3291,7 @@ static void fbcon_exit(void)
 
if (info->queue.func)
pending = cancel_work_sync(>queue);
-   DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
+   pr_debug("fbcon: %s pending work\n", (pending ? "canceled" :
"no"));
 
for (j = first_fb_vc; j <= last_fb_vc; j++) {
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 01/28] video: Fix W=1 warnings in of_videomode + of_display_timing

2020-11-27 Thread Sam Ravnborg
Fix trivial W=1 warnings.
Update kernel-doc to avoid the warnings.

Signed-off-by: Sam Ravnborg 
Cc: Sam Ravnborg 
Cc: linux-fb...@vger.kernel.org
---
 drivers/video/of_display_timing.c | 1 +
 drivers/video/of_videomode.c  | 8 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/video/of_display_timing.c 
b/drivers/video/of_display_timing.c
index abc9ada798ee..f93b6abbe258 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -52,6 +52,7 @@ static int parse_timing_property(const struct device_node 
*np, const char *name,
 /**
  * of_parse_display_timing - parse display_timing entry from device_node
  * @np: device_node with the properties
+ * @dt: display_timing that contains the result. I may be partially written in 
case of errors
  **/
 static int of_parse_display_timing(const struct device_node *np,
struct display_timing *dt)
diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c
index 67aff2421c29..a5bb02f02b44 100644
--- a/drivers/video/of_videomode.c
+++ b/drivers/video/of_videomode.c
@@ -13,10 +13,10 @@
 #include 
 
 /**
- * of_get_videomode - get the videomode # from devicetree
- * @np - devicenode with the display_timings
- * @vm - set to return value
- * @index - index into list of display_timings
+ * of_get_videomode: get the videomode # from devicetree
+ * @np: devicenode with the display_timings
+ * @vm: set to return value
+ * @index: index into list of display_timings
  * (Set this to OF_USE_NATIVE_MODE to use whatever mode is
  *  specified as native mode in the DT.)
  *
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 0/28] drivers/video: W=1 warning fixes

2020-11-27 Thread Sam Ravnborg
Following the great work of Lee Jones in other subsystems
here is a set of patches that address all remaining W=1
warnings in drivers/video/.
Lee Jones already fixed all warnings in video/backlight/ so
this is mostly fbdev related fixes.

The general approach used were:
- Fix kernel-doc, this is often very trivial
- Drop unused local variables
- Use no_printk for local logging support

Build tested on a set of architectures with various configs.

The patches do not depends on each other and in most cases all
fixes for one driver is kept in a single patch.

The individual changes are trivial so this is a great
starter task to try to review these patches.

A timely Reviewed-by: or Acked-by: would be very nice so we can
get the warnings fixes before we cut for the merge window.

Sam


Sam Ravnborg (28):
  video: Fix W=1 warnings in of_videomode + of_display_timing
  video: fbcon: Use pr_debug() in fbcon
  video: fbdev: core: Fix W=1 warnings in fbmon + fb_notify
  video: fbdev: aty: Delete unused variable in radeon_monitor
  video: fbdev: aty: Fix W=1 warnings in atyfb_base
  video: fbdev: aty: Fix W=1 warnings in mach64_ct
  video: fbdev: sis: Fix W=1 warnings about static symbols
  video: fbdev: sis: Fix W=1 warning about SiS_TVDelay
  video: fbdev: sis: Fix W=1 warnings in init.c
  video: fbdev: sis: Fix W=1 warnings in sis_main
  video: fbdev: via: Fix W=1 warnings
  video: fbdev: tdfx: Fix W=1 warnings
  video: fbdev: riva: Fix W=1 warnings
  video: fbdev: pm2fb: Fix W=1 warnings
  video: fbdev: neofb: Fix W=1 warnings
  video: fbdev: hgafb: Fix W=1 warnings
  video: fbdev: tgafb: Fix W=1 warnings
  video: fbdev: mx3fb: Fix W=1 warnings
  video: fbdev: sstfb: Fix W=1 warnings
  video: fbdev: nvidia: Fix W=1 warnings
  video: fbdev: tmiofb: Fix W=1 warnings
  video: fbdev: omapfb: Fix W=1 warnings in dsi
  video: fbdev: omapfb: Fix W=1 warnings in hdmi*_core
  video: fbdev: s3c-fb: Fix W=1 warnings
  video: fbdev: uvesafb: Fix W=1 warning
  video: fbdev: uvesafb: Fix W=1 string related warnings
  video: fbdev: cirrusfb: Fix W=1 warnings
  video: fbdev: s1d13xxxfb: Fix W=1 warnings

 drivers/video/fbdev/aty/atyfb_base.c  | 12 ++--
 drivers/video/fbdev/aty/mach64_ct.c   | 15 ++
 drivers/video/fbdev/aty/radeon_monitor.c  |  4 +--
 drivers/video/fbdev/cirrusfb.c| 20 ++---
 drivers/video/fbdev/core/fb_notify.c  |  3 +-
 drivers/video/fbdev/core/fbcon.c  | 20 -
 drivers/video/fbdev/core/fbmon.c  |  2 +-
 drivers/video/fbdev/hgafb.c   |  4 +--
 drivers/video/fbdev/mx3fb.c   | 13 +
 drivers/video/fbdev/neofb.c   |  4 ---
 drivers/video/fbdev/nvidia/nv_setup.c |  7 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c| 12 ++--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c |  4 +--
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c |  4 +--
 drivers/video/fbdev/pm2fb.c   |  8 +++---
 drivers/video/fbdev/riva/fbdev.c  |  9 +++---
 drivers/video/fbdev/riva/riva_hw.c| 28 ++-
 drivers/video/fbdev/s1d13xxxfb.c  |  3 +-
 drivers/video/fbdev/s3c-fb.c  | 11 
 drivers/video/fbdev/sis/init.c| 34 ---
 drivers/video/fbdev/sis/oem310.h  |  2 ++
 drivers/video/fbdev/sis/sis.h |  1 -
 drivers/video/fbdev/sis/sis_main.c|  9 +++---
 drivers/video/fbdev/sstfb.c   |  2 +-
 drivers/video/fbdev/tdfxfb.c  |  4 +--
 drivers/video/fbdev/tgafb.c   |  7 ++---
 drivers/video/fbdev/tmiofb.c  |  6 ++--
 drivers/video/fbdev/uvesafb.c |  8 +++---
 drivers/video/fbdev/via/lcd.c |  4 +--
 drivers/video/of_display_timing.c |  1 +
 drivers/video/of_videomode.c  |  8 +++---
 include/video/sstfb.h |  4 +--
 32 files changed, 104 insertions(+), 169 deletions(-)


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 00/15] drm: Move struct drm_device.pdev to legacy

2020-11-24 Thread Sam Ravnborg
Hi Thomas.

Nice clean-up series - quite an effort to move one member to deprecated!

I have read through most of the patches. I left a few notes in my
replies but nothing buggy. Just nitpicks.


On Tue, Nov 24, 2020 at 12:38:09PM +0100, Thomas Zimmermann wrote:
> The pdev field in struct drm_device points to a PCI device structure and
> goes back to UMS-only days when all DRM drivers where for PCI devices.
> Meanwhile we also support USB, SPI and platform devices. Each of those
> uses the generic device stored in struct drm_device.dev.
> 
> To reduce duplications and remove the special case of PCI, this patchset
> converts all modesetting drivers from pdev to dev and makes pdev a field
> for legacy UMS drivers.
> 
> For PCI devices, the pointer in struct drm_device.dev can be upcasted to
> struct pci_device; or tested for PCI with dev_is_pci(). In several places
> the code can use the dev field directly.
> 
> After converting all drivers and the DRM core, the pdev fields becomes
> only relevant for legacy drivers. In a later patchset, we may want to
> convert these as well and remove pdev entirely.
> 
> The patchset touches many files, but the individual changes are mostly
> trivial. I suggest to merge each driver's patch through the respective
> tree and later the rest through drm-misc-next.
> 
> Thomas Zimmermann (15):
>   drm/amdgpu: Remove references to struct drm_device.pdev
>   drm/ast: Remove references to struct drm_device.pdev
>   drm/bochs: Remove references to struct drm_device.pdev
>   drm/cirrus: Remove references to struct drm_device.pdev
>   drm/gma500: Remove references to struct drm_device.pdev
>   drm/hibmc: Remove references to struct drm_device.pdev
>   drm/mgag200: Remove references to struct drm_device.pdev
>   drm/qxl: Remove references to struct drm_device.pdev
>   drm/vboxvideo: Remove references to struct drm_device.pdev
>   drm/virtgpu: Remove references to struct drm_device.pdev
>   drm/vmwgfx: Remove references to struct drm_device.pdev
>   drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
All above are:
Acked-by: Sam Ravnborg 

>   drm/nouveau: Remove references to struct drm_device.pdev
I lost my confidence in my reading of this code.

>   drm/i915: Remove references to struct drm_device.pdev
>   drm/radeon: Remove references to struct drm_device.pdev
I did not look at these at all. I hope someone else find time to do so.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 15/15] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev

2020-11-24 Thread Sam Ravnborg
Hi Thomas,

On Tue, Nov 24, 2020 at 12:38:24PM +0100, Thomas Zimmermann wrote:
> We have DRM drivers based on USB, SPI and platform devices. All of them
> are fine with storing their device reference in struct drm_device.dev.
> PCI devices should be no exception. Therefore struct drm_device.pdev is
> deprecated.
> 
> Instead upcast from struct drm_device.dev with to_pci_dev(). PCI-specific
> code can use dev_is_pci() to test for a PCI device. This patch changes
> the DRM core code and documentation accordingly. Struct drm_device.pdev
> is being moved to legacy status.
> 
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_agpsupport.c |  9 ++---
>  drivers/gpu/drm/drm_bufs.c   |  4 ++--
>  drivers/gpu/drm/drm_edid.c   |  7 ++-
>  drivers/gpu/drm/drm_irq.c| 12 +++-
>  drivers/gpu/drm/drm_pci.c| 26 +++---
>  drivers/gpu/drm/drm_vm.c |  2 +-
>  include/drm/drm_device.h | 12 +---
>  7 files changed, 46 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_agpsupport.c 
> b/drivers/gpu/drm/drm_agpsupport.c
> index 4c7ad46fdd21..a4040fe4f4ba 100644
> --- a/drivers/gpu/drm/drm_agpsupport.c
> +++ b/drivers/gpu/drm/drm_agpsupport.c
> @@ -103,11 +103,13 @@ int drm_agp_info_ioctl(struct drm_device *dev, void 
> *data,
>   */
>  int drm_agp_acquire(struct drm_device *dev)
>  {
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
> +
>   if (!dev->agp)
>   return -ENODEV;
>   if (dev->agp->acquired)
>   return -EBUSY;
> - dev->agp->bridge = agp_backend_acquire(dev->pdev);
> + dev->agp->bridge = agp_backend_acquire(pdev);
>   if (!dev->agp->bridge)
>   return -ENODEV;
>   dev->agp->acquired = 1;
> @@ -402,14 +404,15 @@ int drm_agp_free_ioctl(struct drm_device *dev, void 
> *data,
>   */
>  struct drm_agp_head *drm_agp_init(struct drm_device *dev)
>  {
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
>   struct drm_agp_head *head = NULL;
>  
>   head = kzalloc(sizeof(*head), GFP_KERNEL);
>   if (!head)
>   return NULL;
> - head->bridge = agp_find_bridge(dev->pdev);
> + head->bridge = agp_find_bridge(pdev);
>   if (!head->bridge) {
> - head->bridge = agp_backend_acquire(dev->pdev);
> + head->bridge = agp_backend_acquire(pdev);
>   if (!head->bridge) {
>   kfree(head);
>   return NULL;
> diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
> index 7a01d0918861..1da8b360b60a 100644
> --- a/drivers/gpu/drm/drm_bufs.c
> +++ b/drivers/gpu/drm/drm_bufs.c
> @@ -325,7 +325,7 @@ static int drm_addmap_core(struct drm_device *dev, 
> resource_size_t offset,
>* As we're limiting the address to 2^32-1 (or less),
>* casting it down to 32 bits is no problem, but we
>* need to point to a 64bit variable first. */
> - map->handle = dma_alloc_coherent(>pdev->dev,
> + map->handle = dma_alloc_coherent(dev->dev,
>map->size,
>>offset,
>GFP_KERNEL);
> @@ -555,7 +555,7 @@ int drm_legacy_rmmap_locked(struct drm_device *dev, 
> struct drm_local_map *map)
>   case _DRM_SCATTER_GATHER:
>   break;
>   case _DRM_CONSISTENT:
> - dma_free_coherent(>pdev->dev,
> + dma_free_coherent(dev->dev,
> map->size,
> map->handle,
> map->offset);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 74f5a3197214..555a04ce2179 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -32,6 +32,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> @@ -2075,9 +2076,13 @@ EXPORT_SYMBOL(drm_get_edid);
>  struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
>struct i2c_adapter *adapter)
>  {
> - struct pci_dev *pdev = connector->dev->pdev;
> + struct drm_device *dev = connector->dev;
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
>   struct edid *edid;

Maybe add a comment that explain why this can trigger - so people are
helped it they are catched by this.
As it is now it is not even mentioned in the changelog.

> + if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev)))
> + return NULL;
> +
>   vga_switcheroo_lock_ddc(pdev);
>   edid = drm_get_edid(connector, adapter);
>   vga_switcheroo_unlock_ddc(pdev);
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 09d6e9e2e075..22986a9a593b 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -122,7 +122,7 @@ int drm_irq_install(struct drm_device *dev, int 

Re: [PATCH 09/15] drm/nouveau: Remove references to struct drm_device.pdev

2020-11-24 Thread Sam Ravnborg
Hi Thomas.

On Tue, Nov 24, 2020 at 12:38:18PM +0100, Thomas Zimmermann wrote:
> Using struct drm_device.pdev is deprecated. Convert nouveau to struct
> drm_device.dev. No functional changes.
> 
> Signed-off-by: Thomas Zimmermann 
> Cc: Ben Skeggs 

Suggestion to an alternative implmentation below.

> ---
>  drivers/gpu/drm/nouveau/dispnv04/arb.c  | 12 +++-
>  drivers/gpu/drm/nouveau/dispnv04/disp.h | 14 --
>  drivers/gpu/drm/nouveau/dispnv04/hw.c   | 10 ++
>  drivers/gpu/drm/nouveau/nouveau_abi16.c |  7 ---
>  drivers/gpu/drm/nouveau/nouveau_acpi.c  |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_bios.c  | 11 ---
>  drivers/gpu/drm/nouveau/nouveau_connector.c | 10 ++
>  drivers/gpu/drm/nouveau/nouveau_drm.c   |  5 ++---
>  drivers/gpu/drm/nouveau/nouveau_fbcon.c |  6 --
>  drivers/gpu/drm/nouveau/nouveau_vga.c   | 20 
>  10 files changed, 58 insertions(+), 39 deletions(-)
> 

> diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c 
> b/drivers/gpu/drm/nouveau/nouveau_bios.c
> index d204ea8a5618..7cc683b8dc7a 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bios.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
> @@ -110,6 +110,9 @@ static int call_lvds_manufacturer_script(struct 
> drm_device *dev, struct dcb_outp
>   struct nvbios *bios = >vbios;
>   uint8_t sub = bios->data[bios->fp.xlated_entry + script] + 
> (bios->fp.link_c_increment && dcbent->or & DCB_OUTPUT_C ? 1 : 0);
>   uint16_t scriptofs = ROM16(bios->data[bios->init_script_tbls_ptr + sub 
> * 2]);
> +#ifdef __powerpc__
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
> +#endif
Or
int device = 0;
>  
>   if (!bios->fp.xlated_entry || !sub || !scriptofs)
>   return -EINVAL;
> @@ -123,8 +126,8 @@ static int call_lvds_manufacturer_script(struct 
> drm_device *dev, struct dcb_outp
>  #ifdef __powerpc__
>   /* Powerbook specific quirks */
device = to_pci_dev(dev->dev)->device;
if (script == LVDS_RESET && (device == 0x0179 || device == 0x0189 || 
device == 0x0329))

>   if (script == LVDS_RESET &&
> - (dev->pdev->device == 0x0179 || dev->pdev->device == 0x0189 ||
> -  dev->pdev->device == 0x0329))
> + (pdev->device == 0x0179 || pdev->device == 0x0189 ||
> +  pdev->device == 0x0329))
>   nv_write_tmds(dev, dcbent->or, 0, 0x02, 0x72);
>  #endif
>  


> diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c 
> b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
> index 24ec5339efb4..4fc0fa696461 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
> @@ -396,7 +396,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
>   NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n",
>   fb->width, fb->height, nvbo->offset, nvbo);
>  
> - vga_switcheroo_client_fb_set(dev->pdev, info);
> + if (dev_is_pci(dev->dev))
> + vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), info);
> +
I cannot see why dev_is_pci() is needed here.
So I am obviously missing something :-(

>   return 0;
>  
>  out_unlock:
> @@ -548,7 +550,7 @@ nouveau_fbcon_init(struct drm_device *dev)
>   int ret;
>  
>   if (!dev->mode_config.num_crtc ||
> - (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
> + (to_pci_dev(dev->dev)->class >> 8) != PCI_CLASS_DISPLAY_VGA)
>   return 0;
>  
>   fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
> diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c 
> b/drivers/gpu/drm/nouveau/nouveau_vga.c
> index c85dd8afa3c3..7c4b374b3eca 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_vga.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
> @@ -87,18 +87,20 @@ nouveau_vga_init(struct nouveau_drm *drm)
>  {
>   struct drm_device *dev = drm->dev;
>   bool runtime = nouveau_pmops_runtime();
> + struct pci_dev *pdev;
>  
>   /* only relevant for PCI devices */
> - if (!dev->pdev)
> + if (!dev_is_pci(dev->dev))
>   return;
> + pdev = to_pci_dev(dev->dev);
>  
> - vga_client_register(dev->pdev, dev, NULL, nouveau_vga_set_decode);
> + vga_client_register(pdev, dev, NULL, nouveau_vga_set_decode);
>  
>   /* don't register Thunderbolt eGPU with vga_switcheroo */
> - if (pci_is_thunderbolt_attached(dev->pdev))
> + if (pci_is_thunderbolt_attached(pdev))
>   return;
>  
> - vga_switcheroo_register_client(dev->pdev, _switcheroo_ops, 
> runtime);
> + vga_switcheroo_register_client(pdev, _switcheroo_ops, runtime);
>  
>   if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
>   vga_switcheroo_init_domain_pm_ops(drm->dev->dev, 
> >vga_pm_domain);
> @@ -109,17 +111,19 @@ nouveau_vga_fini(struct nouveau_drm *drm)
>  {
>   struct drm_device *dev = drm->dev;
>   bool runtime = nouveau_pmops_runtime();
> + struct pci_dev *pdev;
>  
>   /* only 

Re: [PATCH 05/15] drm/gma500: Remove references to struct drm_device.pdev

2020-11-24 Thread Sam Ravnborg
Hi Thomas.

On Tue, Nov 24, 2020 at 12:38:14PM +0100, Thomas Zimmermann wrote:
> Using struct drm_device.pdev is deprecated. Convert gma500 to struct
> drm_device.dev. No functional changes.
> 
> Signed-off-by: Thomas Zimmermann 
> Cc: Patrik Jakobsson 

This patch includes several whitespace changes too.
It would be nice to avoid these as the patch is already large enough.

Browsing the patch it was not so many, it looked like more in the start
of the patch.

Sam

> ---
>  drivers/gpu/drm/gma500/cdv_device.c| 30 +++---
>  drivers/gpu/drm/gma500/cdv_intel_crt.c |  3 +-
>  drivers/gpu/drm/gma500/cdv_intel_lvds.c|  4 +--
>  drivers/gpu/drm/gma500/framebuffer.c   |  9 +++---
>  drivers/gpu/drm/gma500/gma_device.c|  3 +-
>  drivers/gpu/drm/gma500/gma_display.c   |  4 +--
>  drivers/gpu/drm/gma500/gtt.c   | 20 ++--
>  drivers/gpu/drm/gma500/intel_bios.c|  6 ++--
>  drivers/gpu/drm/gma500/intel_gmbus.c   |  4 +--
>  drivers/gpu/drm/gma500/intel_i2c.c |  2 +-
>  drivers/gpu/drm/gma500/mdfld_device.c  |  4 ++-
>  drivers/gpu/drm/gma500/mdfld_dsi_dpi.c |  8 ++---
>  drivers/gpu/drm/gma500/mid_bios.c  |  9 --
>  drivers/gpu/drm/gma500/oaktrail_device.c   |  5 +--
>  drivers/gpu/drm/gma500/oaktrail_lvds.c |  2 +-
>  drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c |  2 +-
>  drivers/gpu/drm/gma500/opregion.c  |  3 +-
>  drivers/gpu/drm/gma500/power.c | 13 
>  drivers/gpu/drm/gma500/psb_drv.c   | 16 +-
>  drivers/gpu/drm/gma500/psb_drv.h   |  8 ++---
>  drivers/gpu/drm/gma500/psb_intel_lvds.c|  6 ++--
>  drivers/gpu/drm/gma500/psb_intel_sdvo.c|  2 +-
>  drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c | 36 +++---
>  23 files changed, 109 insertions(+), 90 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/cdv_device.c 
> b/drivers/gpu/drm/gma500/cdv_device.c
> index e75293e4a52f..19e055dbd4c2 100644
> --- a/drivers/gpu/drm/gma500/cdv_device.c
> +++ b/drivers/gpu/drm/gma500/cdv_device.c
> @@ -95,13 +95,14 @@ static u32 cdv_get_max_backlight(struct drm_device *dev)
>  static int cdv_get_brightness(struct backlight_device *bd)
>  {
>   struct drm_device *dev = bl_get_data(bd);
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
>   u32 val = REG_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK;
>  
>   if (cdv_backlight_combination_mode(dev)) {
>   u8 lbpc;
>  
>   val &= ~1;
> - pci_read_config_byte(dev->pdev, 0xF4, );
> + pci_read_config_byte(pdev, 0xF4, );
>   val *= lbpc;
>   }
>   return (val * 100)/cdv_get_max_backlight(dev);
> @@ -111,6 +112,7 @@ static int cdv_get_brightness(struct backlight_device *bd)
>  static int cdv_set_brightness(struct backlight_device *bd)
>  {
>   struct drm_device *dev = bl_get_data(bd);
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
>   int level = bd->props.brightness;
>   u32 blc_pwm_ctl;
>  
> @@ -128,7 +130,7 @@ static int cdv_set_brightness(struct backlight_device *bd)
>   lbpc = level * 0xfe / max + 1;
>   level /= lbpc;
>  
> - pci_write_config_byte(dev->pdev, 0xF4, lbpc);
> + pci_write_config_byte(pdev, 0xF4, lbpc);
>   }
>  
>   blc_pwm_ctl = REG_READ(BLC_PWM_CTL) & ~BACKLIGHT_DUTY_CYCLE_MASK;
> @@ -205,8 +207,9 @@ static inline void CDV_MSG_WRITE32(int domain, uint port, 
> uint offset,
>  static void cdv_init_pm(struct drm_device *dev)
>  {
>   struct drm_psb_private *dev_priv = dev->dev_private;
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
>   u32 pwr_cnt;
> - int domain = pci_domain_nr(dev->pdev->bus);
> + int domain = pci_domain_nr(pdev->bus);
>   int i;
>  
>   dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
> @@ -234,6 +237,8 @@ static void cdv_init_pm(struct drm_device *dev)
>  
>  static void cdv_errata(struct drm_device *dev)
>  {
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
> +
>   /* Disable bonus launch.
>*  CPU and GPU competes for memory and display misses updates and
>*  flickers. Worst with dual core, dual displays.
> @@ -242,7 +247,7 @@ static void cdv_errata(struct drm_device *dev)
>*  Bonus Launch to work around the issue, by degrading
>*  performance.
>*/
> -  CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
> +  CDV_MSG_WRITE32(pci_domain_nr(pdev->bus), 3, 0x30, 0x08027108);
>  }
>  
>  /**
> @@ -255,12 +260,13 @@ static void cdv_errata(struct drm_device *dev)
>  static int cdv_save_display_registers(struct drm_device *dev)
>  {
>   struct drm_psb_private *dev_priv = dev->dev_private;
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
>   struct psb_save_area *regs = _priv->regs;
>   struct drm_connector *connector;
>  
>   dev_dbg(dev->dev, "Saving GPU registers.\n");
> 

Re: [PATCH 1/2] panel-simple: add Innolux N125HCE-GN1

2020-11-24 Thread Sam Ravnborg
Hi Lukas.

On Tue, Nov 24, 2020 at 06:26:04PM +0100, Lukas F. Hartmann wrote:
> The Innolux N125HCE-GN1 display is used in the MNT Reform 2.0 laptop,
> attached via eDP to a SN65DSI86 MIPI-DSI to eDP bridge.
> 
> Signed-off-by: Lukas F. Hartmann 

Danke, applied to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 2/2] dt-bindings: display/panel: add Innolux N125HCE-GN1

2020-11-24 Thread Sam Ravnborg
Hi Lukas

On Tue, Nov 24, 2020 at 06:26:06PM +0100, Lukas F. Hartmann wrote:
> The Innolux N125HCE-GN1 display is used in the MNT Reform 2.0 laptop,
> attached via eDP to a SN65DSI86 MIPI-DSI to eDP bridge. This patch
> contains the DT binding for "innolux,n125hce-gn1".
> 
> Signed-off-by: Lukas F. Hartmann 

bindings before their usage, so this should be first patch.

> ---
>  .../devicetree/bindings/display/panel/panel-simple.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml 
> b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> index edb53ab0d..03b3e0b9d 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> @@ -160,6 +160,8 @@ properties:
>  # Innolux Corporation 11.6" WXGA (1366x768) TFT LCD panel
>- innolux,n116bge
>  # InnoLux 15.6" WXGA TFT LCD panel
> +  - innolux,n125hce-gn1
> +# InnoLux 13.3" FHD (1920x1080) eDP TFT LCD panel

Comments before the compatible.

I applied this first and reordered the comment - so both details are
handled.

Applied to drm-misc-next.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 70/80] drm/panel: panel-dsi-cm: drop unneeded includes

2020-11-24 Thread Sam Ravnborg
On Tue, Nov 24, 2020 at 02:45:28PM +0200, Tomi Valkeinen wrote:
> Drop unneeded includes.
> 
> Signed-off-by: Tomi Valkeinen 
I trust the compiler here.
Reviewed-by: Sam Ravnborg 

> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index ec87b785871f..91ed8237a1c2 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -9,12 +9,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
> -#include 
> -#include 
> -#include 
> -#include 
>  #include 
>  
>  #include 
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 69/80] drm/panel: panel-dsi-cm: add panel database to driver

2020-11-24 Thread Sam Ravnborg
On Tue, Nov 24, 2020 at 02:45:27PM +0200, Tomi Valkeinen wrote:
> Add a panel database to the driver instead of reading propertes from DT
> data. This is similar to panel-simple, and I believe it's more future
> safe way to handle the panels.
> 
> Signed-off-by: Tomi Valkeinen 

Looks good, and you remembered to drop the unsed includes - nice.

Reviewed-by: Sam Ravnborg 


> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 107 +--
>  1 file changed, 69 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index c17ed728c695..ec87b785871f 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -22,10 +22,7 @@
>  #include 
>  #include 
>  
> -#include 
>  #include 
> -#include 
> -#include 
>  
>  #define DCS_GET_ID1  0xda
>  #define DCS_GET_ID2  0xdb
> @@ -33,6 +30,18 @@
>  
>  #define DCS_REGULATOR_SUPPLY_NUM 2
>  
> +static const struct of_device_id dsicm_of_match[];
> +
> +struct dsic_panel_data {
> + u32 xres;
> + u32 yres;
> + u32 refresh;
> + u32 width_mm;
> + u32 height_mm;
> + u32 max_hs_rate;
> + u32 max_lp_rate;
> +};
> +
>  struct panel_drv_data {
>   struct mipi_dsi_device *dsi;
>   struct drm_panel panel;
> @@ -48,16 +57,14 @@ struct panel_drv_data {
>*/
>   unsigned long   hw_guard_wait;  /* max guard time in jiffies */
>  
> - /* panel HW configuration from DT or platform data */
> + const struct dsic_panel_data *panel_data;
> +
>   struct gpio_desc *reset_gpio;
>  
>   struct regulator_bulk_data supplies[DCS_REGULATOR_SUPPLY_NUM];
>  
>   bool use_dsi_backlight;
>  
> - int width_mm;
> - int height_mm;
> -
>   /* runtime variables */
>   bool enabled;
>  
> @@ -455,11 +462,8 @@ static int dsicm_get_modes(struct drm_panel *panel,
>   return -ENOMEM;
>   }
>  
> - drm_mode_set_name(mode);
> - mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> -
> - connector->display_info.width_mm = ddata->width_mm;
> - connector->display_info.height_mm = ddata->height_mm;
> + connector->display_info.width_mm = ddata->panel_data->width_mm;
> + connector->display_info.height_mm = ddata->panel_data->height_mm;
>  
>   drm_mode_probed_add(connector, mode);
>  
> @@ -476,15 +480,10 @@ static const struct drm_panel_funcs dsicm_panel_funcs = 
> {
>  
>  static int dsicm_probe_of(struct mipi_dsi_device *dsi)
>  {
> - struct device_node *node = dsi->dev.of_node;
>   struct backlight_device *backlight;
>   struct panel_drv_data *ddata = mipi_dsi_get_drvdata(dsi);
> - struct display_timing timing;
> - struct videomode vm = {
> - .hactive = 864,
> - .vactive = 480,
> - };
>   int err;
> + struct drm_display_mode *mode = >mode;
>  
>   ddata->reset_gpio = devm_gpiod_get(>dev, "reset", GPIOD_OUT_LOW);
>   if (IS_ERR(ddata->reset_gpio)) {
> @@ -493,23 +492,16 @@ static int dsicm_probe_of(struct mipi_dsi_device *dsi)
>   return err;
>   }
>  
> - err = of_get_display_timing(node, "panel-timing", );
> - if (!err) {
> - videomode_from_timing(, );
> - } else {
> - dev_warn(>dev,
> -  "failed to get video timing, using defaults\n");
> - }
> -
> - if (!vm.pixelclock)
> - vm.pixelclock = vm.hactive * vm.vactive * 60;
> - drm_display_mode_from_videomode(, >mode);
> -
> - ddata->width_mm = 0;
> - of_property_read_u32(node, "width-mm", >width_mm);
> -
> - ddata->height_mm = 0;
> - of_property_read_u32(node, "height-mm", >height_mm);
> + mode->hdisplay = mode->hsync_start = mode->hsync_end = mode->htotal =
> + ddata->panel_data->xres;
> + mode->vdisplay = mode->vsync_start = mode->vsync_end = mode->vtotal =
> + ddata->panel_data->yres;
> + mode->clock = ddata->panel_data->xres * ddata->panel_data->yres *
> + ddata->panel_data->refresh / 1000;
> + mode->width_mm = ddata->panel_data->width_mm;
> + mode->height_mm = ddata->panel_data->height_mm;
> + mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> + drm_mode_set_name(mode);
>  
>   ddata->supplies[0].supply = "vpnl";
> 

Re: [PATCH v4 68/80] drm/panel: panel-dsi-cm: remove extra 'if'

2020-11-24 Thread Sam Ravnborg
Hi Tomi,

On Tue, Nov 24, 2020 at 02:45:26PM +0200, Tomi Valkeinen wrote:
> We have a useless 'if' in the dsicm_bl_update_status(), a left over from
> the conversion to DRM model. Drop the if.
> 
> Signed-off-by: Tomi Valkeinen 
Reviewed-by: Sam Ravnborg 

But with a few comments.

> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index 1e7f73340736..c17ed728c695 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -194,7 +194,7 @@ static int dsicm_set_update_window(struct panel_drv_data 
> *ddata)
>  static int dsicm_bl_update_status(struct backlight_device *dev)
>  {
>   struct panel_drv_data *ddata = dev_get_drvdata(>dev);
> - int r = 0;
> + int r;
>   int level;
>  
>   if (dev->props.fb_blank == FB_BLANK_UNBLANK &&

Unrelated to this patch - but here it would be better to use
level = backlight_get_brightness(dev);

level is 0 is backlight is off.

Sam


> @@ -207,11 +207,9 @@ static int dsicm_bl_update_status(struct 
> backlight_device *dev)
>  
>   mutex_lock(>lock);
>  
> - if (ddata->enabled) {
> - if (!r)
> - r = dsicm_dcs_write_1(
> - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level);
> - }
> + if (ddata->enabled)
> + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
> +   level);
>  
>   mutex_unlock(>lock);
>  
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 60/80] drm/panel: panel-dsi-cm: set column & page at setup

2020-11-24 Thread Sam Ravnborg
On Tue, Nov 24, 2020 at 02:45:18PM +0200, Tomi Valkeinen wrote:
> Set the column & page address once during setup, instead of relying the
> DSI host driver to set those.
> 
> Signed-off-by: Tomi Valkeinen 
Reviewed-by: Sam Ravnborg 

But one comment below.

> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 24 
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index 59e8e6b18e97..1e7f73340736 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -171,6 +171,26 @@ static int dsicm_get_id(struct panel_drv_data *ddata, u8 
> *id1, u8 *id2, u8 *id3)
>   return 0;
>  }
>  
> +static int dsicm_set_update_window(struct panel_drv_data *ddata)
> +{
> + struct mipi_dsi_device *dsi = ddata->dsi;
> + int r;
> + u16 x1 = 0;
> + u16 x2 = ddata->mode.hdisplay - 1;
> + u16 y1 = 0;
> + u16 y2 = ddata->mode.vdisplay - 1;

It does not help the readability with the variables.

Using

r = mipi_dsi_dcs_set_column_address(dsi, 0, ddata->mode.hdisplay - 1);

would IMO be easier to parse.

Then the pointless assignment of x1 and y1 are dropped too.

But nitpicking, ignore if think the current code is better.

Sam


> +
> + r = mipi_dsi_dcs_set_column_address(dsi, x1, x2);
> + if (r < 0)
> + return r;
> +
> + r = mipi_dsi_dcs_set_page_address(dsi, y1, y2);
> + if (r < 0)
> + return r;
> +
> + return 0;
> +}
> +
>  static int dsicm_bl_update_status(struct backlight_device *dev)
>  {
>   struct panel_drv_data *ddata = dev_get_drvdata(>dev);
> @@ -308,6 +328,10 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
>   if (r)
>   goto err;
>  
> + r = dsicm_set_update_window(ddata);
> + if (r)
> + goto err;
> +
>   r = mipi_dsi_dcs_set_display_on(ddata->dsi);
>   if (r)
>   goto err;
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 56/80] drm/panel: panel-dsi-cm: cleanup tear enable

2020-11-24 Thread Sam Ravnborg
On Tue, Nov 24, 2020 at 02:45:14PM +0200, Tomi Valkeinen wrote:
> Simplify the code by moving code from _dsicm_enable_te() into
> dsicm_power_on().
> 
> Signed-off-by: Tomi Valkeinen 
Reviewed-by: Sam Ravnborg 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 55/80] drm/panel: panel-dsi-cm: use MIPI_DCS_GET_ERROR_COUNT_ON_DSI

2020-11-24 Thread Sam Ravnborg
Hi Tomi

On Tue, Nov 24, 2020 at 06:26:47PM +0200, Tomi Valkeinen wrote:
> Hi Sam,
> 
> On 24/11/2020 18:18, Sam Ravnborg wrote:
> > Hi Tomi,
> > 
> > On Tue, Nov 24, 2020 at 02:45:13PM +0200, Tomi Valkeinen wrote:
> >> Use the common MIPI_DCS_GET_ERROR_COUNT_ON_DSI define instead of
> >> driver's own.
> >>
> > They are both 5 - OK
> > 
> >> Signed-off-by: Tomi Valkeinen 
> > Reviewed-by: Sam Ravnborg 
> > 
> > IMO you should get all the patches at least up including this patch applied.
> > They are all reviewed/acked. And then you have a much smaller stack of
> > patches to spam us with.
> 
> Yes, I think that makes sense. I did not want to merge them earlier, as with 
> the v3, I could not get
> videomode panels work at all (while cmd mode panels did work). So I was not 
> sure if something is
> totally silly and broken in the series.
> 
> Now that I can get video mode panels work with some hacks on top, I'm fine 
> with merging these.
> 
> But it's too late for 5.11, as we need testing and work on the video mode 
> panels. So targeting 5.12.
Obviously your call, but I see no reason to wait for working videomode
panles if what you have now do not introduce any (known) regressions.

ofc I assume videomode panels is something new and not something that worked
before.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 55/80] drm/panel: panel-dsi-cm: use MIPI_DCS_GET_ERROR_COUNT_ON_DSI

2020-11-24 Thread Sam Ravnborg
Hi Tomi,

On Tue, Nov 24, 2020 at 02:45:13PM +0200, Tomi Valkeinen wrote:
> Use the common MIPI_DCS_GET_ERROR_COUNT_ON_DSI define instead of
> driver's own.
> 
They are both 5 - OK

> Signed-off-by: Tomi Valkeinen 
Reviewed-by: Sam Ravnborg 

IMO you should get all the patches at least up including this patch applied.
They are all reviewed/acked. And then you have a much smaller stack of
patches to spam us with.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


  1   2   3   4   5   6   7   8   9   10   >