All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/omap: fix uninitialized ret variable
@ 2018-03-29 10:40 Tomi Valkeinen
  2018-03-29 10:40 ` [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Tomi Valkeinen
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2018-03-29 10:40 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, Laurent Pinchart

audio_config function for both HDMI4 and HDMI5 return uninitialized
value as the error code if the display is not currently enabled. For
some reason this has not caused any issues.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/hdmi4.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 97c88861d67a..5879f45f6fc9 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -679,7 +679,7 @@ static int hdmi_audio_config(struct device *dev,
 			     struct omap_dss_audio *dss_audio)
 {
 	struct omap_hdmi *hd = dev_get_drvdata(dev);
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&hd->lock);
 
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index d28da9ac3e90..ae1a001d1b83 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -671,7 +671,7 @@ static int hdmi_audio_config(struct device *dev,
 			     struct omap_dss_audio *dss_audio)
 {
 	struct omap_hdmi *hd = dev_get_drvdata(dev);
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&hd->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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d
  2018-03-29 10:40 [PATCH 1/3] drm/omap: fix uninitialized ret variable Tomi Valkeinen
@ 2018-03-29 10:40 ` Tomi Valkeinen
  2018-03-29 11:02   ` Emil Velikov
  2018-04-03 11:03   ` Laurent Pinchart
  2018-03-29 10:40 ` [PATCH 3/3] drm/omap: remove unused function Tomi Valkeinen
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2018-03-29 10:40 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, Laurent Pinchart

tiler_reserve_2d allocates memory but does not check if it got the
memory. Add the check and return ENOMEM on failure.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index c40f90d2db82..28d93ece191e 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -532,6 +532,9 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w,
 	unsigned long flags;
 	u32 slot_bytes;
 
+	if (!block)
+		return ERR_PTR(-ENOMEM);
+
 	BUG_ON(!validfmt(fmt));
 
 	/* convert width/height to slots */
-- 
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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 10:40 [PATCH 1/3] drm/omap: fix uninitialized ret variable Tomi Valkeinen
  2018-03-29 10:40 ` [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Tomi Valkeinen
@ 2018-03-29 10:40 ` Tomi Valkeinen
  2018-03-29 11:00   ` Emil Velikov
  2018-03-29 10:58 ` [PATCH 1/3] drm/omap: fix uninitialized ret variable Emil Velikov
  2018-04-03 11:01 ` Laurent Pinchart
  3 siblings, 1 reply; 15+ messages in thread
From: Tomi Valkeinen @ 2018-03-29 10:40 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Valkeinen, Laurent Pinchart

omap_framebuffer_get_next_connector() is not used, remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_fb.c | 27 ---------------------------
 drivers/gpu/drm/omapdrm/omap_fb.h |  2 --
 2 files changed, 29 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 5fd22ca73913..b54bcaad5cd1 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -309,33 +309,6 @@ void omap_framebuffer_unpin(struct drm_framebuffer *fb)
 	mutex_unlock(&omap_fb->lock);
 }
 
-/* iterate thru all the connectors, returning ones that are attached
- * to the same fb..
- */
-struct drm_connector *omap_framebuffer_get_next_connector(
-		struct drm_framebuffer *fb, struct drm_connector *from)
-{
-	struct drm_device *dev = fb->dev;
-	struct list_head *connector_list = &dev->mode_config.connector_list;
-	struct drm_connector *connector = from;
-
-	if (!from)
-		return list_first_entry_or_null(connector_list, typeof(*from),
-						head);
-
-	list_for_each_entry_from(connector, connector_list, head) {
-		if (connector != from) {
-			struct drm_encoder *encoder = connector->encoder;
-			struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
-			if (crtc && crtc->primary->fb == fb)
-				return connector;
-
-		}
-	}
-
-	return NULL;
-}
-
 #ifdef CONFIG_DEBUG_FS
 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m)
 {
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h
index 94ad5f9e4404..c20cb4bc714d 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.h
+++ b/drivers/gpu/drm/omapdrm/omap_fb.h
@@ -38,8 +38,6 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb);
 void omap_framebuffer_unpin(struct drm_framebuffer *fb);
 void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
 		struct drm_plane_state *state, struct omap_overlay_info *info);
-struct drm_connector *omap_framebuffer_get_next_connector(
-		struct drm_framebuffer *fb, struct drm_connector *from);
 bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
 
-- 
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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] drm/omap: fix uninitialized ret variable
  2018-03-29 10:40 [PATCH 1/3] drm/omap: fix uninitialized ret variable Tomi Valkeinen
  2018-03-29 10:40 ` [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Tomi Valkeinen
  2018-03-29 10:40 ` [PATCH 3/3] drm/omap: remove unused function Tomi Valkeinen
@ 2018-03-29 10:58 ` Emil Velikov
  2018-03-29 12:11   ` Tomi Valkeinen
  2018-04-03 11:01 ` Laurent Pinchart
  3 siblings, 1 reply; 15+ messages in thread
From: Emil Velikov @ 2018-03-29 10:58 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Laurent Pinchart, ML dri-devel

On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> audio_config function for both HDMI4 and HDMI5 return uninitialized
> value as the error code if the display is not currently enabled. For
> some reason this has not caused any issues.
>
Doubt many people try hdmi audio with disabled display ;-)

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 10:40 ` [PATCH 3/3] drm/omap: remove unused function Tomi Valkeinen
@ 2018-03-29 11:00   ` Emil Velikov
  2018-03-29 12:31     ` Sebastian Reichel
  0 siblings, 1 reply; 15+ messages in thread
From: Emil Velikov @ 2018-03-29 11:00 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Laurent Pinchart, ML dri-devel

On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> omap_framebuffer_get_next_connector() is not used, remove it.
>
Seems to have been unused for a few years now.
Namely since commit 5a35876e2830511cb8110667fc426c6a6165a593

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d
  2018-03-29 10:40 ` [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Tomi Valkeinen
@ 2018-03-29 11:02   ` Emil Velikov
  2018-04-03 11:03   ` Laurent Pinchart
  1 sibling, 0 replies; 15+ messages in thread
From: Emil Velikov @ 2018-03-29 11:02 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Laurent Pinchart, ML dri-devel

On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> tiler_reserve_2d allocates memory but does not check if it got the
> memory. Add the check and return ENOMEM on failure.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
It's funny when the function call (kzalloc here) is just outside the context ;-)

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] drm/omap: fix uninitialized ret variable
  2018-03-29 10:58 ` [PATCH 1/3] drm/omap: fix uninitialized ret variable Emil Velikov
@ 2018-03-29 12:11   ` Tomi Valkeinen
  0 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2018-03-29 12:11 UTC (permalink / raw)
  To: Emil Velikov; +Cc: Laurent Pinchart, ML dri-devel

On 29/03/18 13:58, Emil Velikov wrote:
> On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> audio_config function for both HDMI4 and HDMI5 return uninitialized
>> value as the error code if the display is not currently enabled. For
>> some reason this has not caused any issues.
>>
> Doubt many people try hdmi audio with disabled display ;-)

I think it can happen if the display is connected but blanked.

> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

Thanks for the review!

 Tomi

-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 11:00   ` Emil Velikov
@ 2018-03-29 12:31     ` Sebastian Reichel
  2018-03-29 12:49       ` Tomi Valkeinen
  2018-03-29 13:24       ` Emil Velikov
  0 siblings, 2 replies; 15+ messages in thread
From: Sebastian Reichel @ 2018-03-29 12:31 UTC (permalink / raw)
  To: Emil Velikov; +Cc: Tomi Valkeinen, Laurent Pinchart, ML dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 572 bytes --]

Hi,

On Thu, Mar 29, 2018 at 12:00:18PM +0100, Emil Velikov wrote:
> On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> > omap_framebuffer_get_next_connector() is not used, remove it.
> >
> Seems to have been unused for a few years now.
> Namely since commit 5a35876e2830511cb8110667fc426c6a6165a593
> 
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

I have a pending patch using that function to basically restore the
functionality from the referenced commit:

https://patchwork.kernel.org/patch/10207759/

-- Sebastian

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 12:31     ` Sebastian Reichel
@ 2018-03-29 12:49       ` Tomi Valkeinen
  2018-03-29 14:44         ` Sebastian Reichel
  2018-03-29 13:24       ` Emil Velikov
  1 sibling, 1 reply; 15+ messages in thread
From: Tomi Valkeinen @ 2018-03-29 12:49 UTC (permalink / raw)
  To: Sebastian Reichel, Emil Velikov; +Cc: Laurent Pinchart, ML dri-devel

On 29/03/18 15:31, Sebastian Reichel wrote:
> Hi,
> 
> On Thu, Mar 29, 2018 at 12:00:18PM +0100, Emil Velikov wrote:
>> On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>> omap_framebuffer_get_next_connector() is not used, remove it.
>>>
>> Seems to have been unused for a few years now.
>> Namely since commit 5a35876e2830511cb8110667fc426c6a6165a593
>>
>> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> 
> I have a pending patch using that function to basically restore the
> functionality from the referenced commit:

Oh, ok. I'll drop this patch. These was a Klocwork warning for this
function, so the easiest fix was to remove it.

drivers/gpu/drm/omapdrm/omap_fb.c:326 INFINITE_LOOP.LOCAL (2:Error) Analyze
Infinite loop
  * omap_fb.c:326: Entering loop with precondition (from!=0) &&
(connector!=0) && from == connector
  * omap_fb.c:326: condition 0 is always false
  * omap_fb.c:326: condition 0 is always false
  * omap_fb.c:327: condition connector!=from is always false

 Tomi

-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 12:31     ` Sebastian Reichel
  2018-03-29 12:49       ` Tomi Valkeinen
@ 2018-03-29 13:24       ` Emil Velikov
  2018-03-29 14:23         ` Sebastian Reichel
  1 sibling, 1 reply; 15+ messages in thread
From: Emil Velikov @ 2018-03-29 13:24 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Tomi Valkeinen, Laurent Pinchart, ML dri-devel

On 29 March 2018 at 13:31, Sebastian Reichel
<sebastian.reichel@collabora.co.uk> wrote:
> Hi,
>
> On Thu, Mar 29, 2018 at 12:00:18PM +0100, Emil Velikov wrote:
>> On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> > omap_framebuffer_get_next_connector() is not used, remove it.
>> >
>> Seems to have been unused for a few years now.
>> Namely since commit 5a35876e2830511cb8110667fc426c6a6165a593
>>
>> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
>
> I have a pending patch using that function to basically restore the
> functionality from the referenced commit:
>
> https://patchwork.kernel.org/patch/10207759/
>
Hmm I can see very few users of dirtyfb - modesetting, opentegra,
vmgfx, intel (sna only)  + the odd IGT test.

Wondering if that's because it doesn't provide that much of a benefit...
Although it might be because DRM drivers don't fully implement the
functionality ;-)

Just thinking out loud ^^.

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 13:24       ` Emil Velikov
@ 2018-03-29 14:23         ` Sebastian Reichel
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastian Reichel @ 2018-03-29 14:23 UTC (permalink / raw)
  To: Emil Velikov; +Cc: Tomi Valkeinen, Laurent Pinchart, ML dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1689 bytes --]

Hi,

On Thu, Mar 29, 2018 at 02:24:40PM +0100, Emil Velikov wrote:
> On 29 March 2018 at 13:31, Sebastian Reichel
> <sebastian.reichel@collabora.co.uk> wrote:
> > Hi,
> >
> > On Thu, Mar 29, 2018 at 12:00:18PM +0100, Emil Velikov wrote:
> >> On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >> > omap_framebuffer_get_next_connector() is not used, remove it.
> >> >
> >> Seems to have been unused for a few years now.
> >> Namely since commit 5a35876e2830511cb8110667fc426c6a6165a593
> >>
> >> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> >
> > I have a pending patch using that function to basically restore the
> > functionality from the referenced commit:
> >
> > https://patchwork.kernel.org/patch/10207759/
> >
> Hmm I can see very few users of dirtyfb - modesetting, opentegra,
> vmgfx, intel (sna only)  + the odd IGT test.
>
> Wondering if that's because it doesn't provide that much of a benefit...
> Although it might be because DRM drivers don't fully implement the
> functionality ;-)
> 
> Just thinking out loud ^^.

Most DRM drivers don't implement DSI's command mode. That's not
surprising, if you consider that the typical development boards
don't have panels supporting DSI command mode. A quick grep
from me suggested, that rockchip supports DSI command mode and
they also use dirtyfb.

Also the benefit of panel self refresh seems to be big enough,
that intel tries to enable it by default since quite some time
:)

Note, that in mobile phones DSI command mode panels are not as
rare as on the development boards. Nokia N950, N9 and Droid 4
each have one of those displays.

-- Sebastian

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 12:49       ` Tomi Valkeinen
@ 2018-03-29 14:44         ` Sebastian Reichel
  2018-03-30  6:24           ` Tomi Valkeinen
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastian Reichel @ 2018-03-29 14:44 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Emil Velikov, Laurent Pinchart, ML dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1398 bytes --]

Hi,

On Thu, Mar 29, 2018 at 03:49:08PM +0300, Tomi Valkeinen wrote:
> On 29/03/18 15:31, Sebastian Reichel wrote:
> > Hi,
> > 
> > On Thu, Mar 29, 2018 at 12:00:18PM +0100, Emil Velikov wrote:
> >> On 29 March 2018 at 11:40, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >>> omap_framebuffer_get_next_connector() is not used, remove it.
> >>>
> >> Seems to have been unused for a few years now.
> >> Namely since commit 5a35876e2830511cb8110667fc426c6a6165a593
> >>
> >> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> > 
> > I have a pending patch using that function to basically restore the
> > functionality from the referenced commit:
> 
> Oh, ok. I'll drop this patch.

Thanks.

> These was a Klocwork warning for this function, so the easiest fix
> was to remove it.
> 
> drivers/gpu/drm/omapdrm/omap_fb.c:326 INFINITE_LOOP.LOCAL (2:Error) Analyze
> Infinite loop
>   * omap_fb.c:326: Entering loop with precondition (from!=0) &&
> (connector!=0) && from == connector

This makes sense to me, since the code initializes connector to from
and returns early if from is NULL.

>   * omap_fb.c:326: condition 0 is always false
>   * omap_fb.c:326: condition 0 is always false
>   * omap_fb.c:327: condition connector!=from is always false

Looks like list_for_each_entry_from() is not properly understood
by the static checker?

-- Sebastian

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] drm/omap: remove unused function
  2018-03-29 14:44         ` Sebastian Reichel
@ 2018-03-30  6:24           ` Tomi Valkeinen
  0 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2018-03-30  6:24 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Emil Velikov, Laurent Pinchart, ML dri-devel

On 29/03/18 17:44, Sebastian Reichel wrote:

>>   * omap_fb.c:326: condition 0 is always false
>>   * omap_fb.c:326: condition 0 is always false
>>   * omap_fb.c:327: condition connector!=from is always false
> 
> Looks like list_for_each_entry_from() is not properly understood
> by the static checker?

I've seen a bunch of false positives from the checker, but this one is
the first where it indeed looks like the checker is confused. Or
alternatively it's too clever for us =).

 Tomi

-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] drm/omap: fix uninitialized ret variable
  2018-03-29 10:40 [PATCH 1/3] drm/omap: fix uninitialized ret variable Tomi Valkeinen
                   ` (2 preceding siblings ...)
  2018-03-29 10:58 ` [PATCH 1/3] drm/omap: fix uninitialized ret variable Emil Velikov
@ 2018-04-03 11:01 ` Laurent Pinchart
  3 siblings, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2018-04-03 11:01 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday, 29 March 2018 13:40:36 EEST Tomi Valkeinen wrote:
> audio_config function for both HDMI4 and HDMI5 return uninitialized
> value as the error code if the display is not currently enabled. For
> some reason this has not caused any issues.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

I wonder why the compiler hasn't caught this before.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/dss/hdmi4.c | 2 +-
>  drivers/gpu/drm/omapdrm/dss/hdmi5.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index 97c88861d67a..5879f45f6fc9
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> @@ -679,7 +679,7 @@ static int hdmi_audio_config(struct device *dev,
>  			     struct omap_dss_audio *dss_audio)
>  {
>  	struct omap_hdmi *hd = dev_get_drvdata(dev);
> -	int ret;
> +	int ret = 0;
> 
>  	mutex_lock(&hd->lock);
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index d28da9ac3e90..ae1a001d1b83
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> @@ -671,7 +671,7 @@ static int hdmi_audio_config(struct device *dev,
>  			     struct omap_dss_audio *dss_audio)
>  {
>  	struct omap_hdmi *hd = dev_get_drvdata(dev);
> -	int ret;
> +	int ret = 0;
> 
>  	mutex_lock(&hd->lock);


-- 
Regards,

Laurent Pinchart



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d
  2018-03-29 10:40 ` [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Tomi Valkeinen
  2018-03-29 11:02   ` Emil Velikov
@ 2018-04-03 11:03   ` Laurent Pinchart
  1 sibling, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2018-04-03 11:03 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday, 29 March 2018 13:40:37 EEST Tomi Valkeinen wrote:
> tiler_reserve_2d allocates memory but does not check if it got the
> memory. Add the check and return ENOMEM on failure.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index c40f90d2db82..28d93ece191e
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> @@ -532,6 +532,9 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt,
> u16 w, unsigned long flags;
>  	u32 slot_bytes;
> 
> +	if (!block)
> +		return ERR_PTR(-ENOMEM);
> +

I'd write this as

	struct tiler_block *block;
	...

	block = kzalloc(sizeof(*block), GFP_KERNEL);
	if (!block)
		return ERR_PTR(-ENOMEM);

to make it clearer. I'll leave it up to you though, so in any case

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  	BUG_ON(!validfmt(fmt));
> 
>  	/* convert width/height to slots */

-- 
Regards,

Laurent Pinchart



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-04-03 11:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 10:40 [PATCH 1/3] drm/omap: fix uninitialized ret variable Tomi Valkeinen
2018-03-29 10:40 ` [PATCH 2/3] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Tomi Valkeinen
2018-03-29 11:02   ` Emil Velikov
2018-04-03 11:03   ` Laurent Pinchart
2018-03-29 10:40 ` [PATCH 3/3] drm/omap: remove unused function Tomi Valkeinen
2018-03-29 11:00   ` Emil Velikov
2018-03-29 12:31     ` Sebastian Reichel
2018-03-29 12:49       ` Tomi Valkeinen
2018-03-29 14:44         ` Sebastian Reichel
2018-03-30  6:24           ` Tomi Valkeinen
2018-03-29 13:24       ` Emil Velikov
2018-03-29 14:23         ` Sebastian Reichel
2018-03-29 10:58 ` [PATCH 1/3] drm/omap: fix uninitialized ret variable Emil Velikov
2018-03-29 12:11   ` Tomi Valkeinen
2018-04-03 11:01 ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.