linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: Jilai Wang <jilaiw@codeaurora.org>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] drm:msm: Initial Add Writeback Support
Date: Thu, 2 Apr 2015 23:29:53 +0100	[thread overview]
Message-ID: <CACvgo51JCYHrUTmyfiRSWXw5px=-zePzdOM41aMGfVLXATXbHA@mail.gmail.com> (raw)
In-Reply-To: <3b757ab0549f700dafb87abb2cda3ac5.squirrel@www.codeaurora.org>

On 2 April 2015 at 19:07,  <jilaiw@codeaurora.org> wrote:
> Thanks Emil. Please check the comments embedded and for the rest I will
> update the code.
>
>> Hi Jilai,
>>
>> Just a few questions, not really a review as I'm not that familiar
>> with the code.
>>
>>
>>> +++ b/drivers/gpu/drm/msm/Kconfig
>>> @@ -27,6 +27,16 @@ config DRM_MSM_FBDEV
>>>           support. Note that this support also provide the linux console
>>>           support on top of the MSM modesetting driver.
>>>
>>> +config DRM_MSM_WB
>>> +       bool "Enable writeback support for MSM modesetting driver"
>>> +       depends on DRM_MSM
>>> +       depends on VIDEO_V4L2
>>> +       select VIDEOBUF2_CORE
>>> +       default y
>>> +       help
>>> +         Choose this option if you have a need to support writeback
>>> +         connector.
>>> +
>> Is it worth mentioning which devices/SoCs have such connector ?
> If the devices have WB connector, it will be added in the device tree.
>
I was thinking more about listing a one or two SoCs so that one gets
the general idea. Although it might end up more confusing than helpful
as more devices become available. Suggestion withdrawn.


>>> +static struct msm_wb *msm_wb_init(struct platform_device *pdev)
>>> +{
>>> +       struct msm_wb *wb = NULL;
>>> +
>>> +       wb = devm_kzalloc(&pdev->dev, sizeof(*wb), GFP_KERNEL);
>>> +       if (!wb)
>>> +               return ERR_PTR(-ENOMEM);
>>> +
>>> +       wb->pdev = pdev;
>>> +       wb->priv_data = devm_kzalloc(&pdev->dev, sizeof(*wb->priv_data),
>>> +               GFP_KERNEL);
>>> +       if (!wb->priv_data)
>>> +               return ERR_PTR(-ENOMEM);
>>> +
>>> +       if (msm_wb_v4l2_init(wb)) {
>>> +               pr_err("%s: wb v4l2 init failed\n", __func__);
>>> +               return ERR_PTR(-ENODEV);
>>> +       }
>>> +
>> Seems like we're leaking wb and/or wb->priv_data. Add a label and
>> consolidate error handling in there ?
>
> Since the devm_kzalloc function is used here, the system should take care
> freeing the memory.
You're spot on. Somehow I did not notice that we're using the devm_
version of kzalloc.
/me runs in shame :-)

Cheers,
Emil

  parent reply	other threads:[~2015-04-02 22:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 21:12 [PATCH 2/3] drm:msm: Initial Add Writeback Support Jilai Wang
2015-04-02  9:40 ` Paul Bolle
2015-04-02 17:58   ` jilaiw
2015-04-02 18:24     ` Paul Bolle
2015-04-02 18:42       ` Rob Clark
2015-04-02 18:54         ` jilaiw
2015-04-02 18:54         ` jilaiw
2015-04-02 11:48 ` Emil Velikov
2015-04-02 18:07   ` jilaiw
2015-04-02 18:19     ` Rob Clark
2015-04-02 22:29     ` Emil Velikov [this message]
2015-04-02 14:29 ` Rob Clark
2015-04-07  5:59   ` Daniel Vetter
2015-04-07 15:55     ` jilaiw
2015-04-07 18:09       ` [PATCH 2/3] drm:msm: Initial Add Writeback Support (V2) Jilai Wang
2015-08-19 19:00         ` Rob Clark
2015-08-25  7:05           ` Daniel Vetter
2015-08-25 19:11             ` Rob Clark
2015-08-26 12:06               ` Daniel Vetter
2015-04-08  8:07       ` [PATCH 2/3] drm:msm: Initial Add Writeback Support Daniel Vetter
2015-04-08 14:40         ` jilaiw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACvgo51JCYHrUTmyfiRSWXw5px=-zePzdOM41aMGfVLXATXbHA@mail.gmail.com' \
    --to=emil.l.velikov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jilaiw@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).