intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Do not put big intel_crtc_state on the stack
Date: Wed, 20 Jan 2016 10:14:58 +0000	[thread overview]
Message-ID: <569F5E22.7000901@linux.intel.com> (raw)
In-Reply-To: <20160119202217.GT19130@phenom.ffwll.local>


On 19/01/16 20:22, Daniel Vetter wrote:
> On Tue, Jan 19, 2016 at 03:25:17PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Having this on stack triggers the -Wframe-larger-than=1024 and
>> is not nice to put such big things on the kernel stack anyway.
>>
>> This required a little bit of refactoring to handle the new
>> failure path from vlv_force_pll_on.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Cc: John Harrison <john.c.harrison@intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> ---
>> Compile tested only!
>> ---
>>   drivers/gpu/drm/i915/intel_display.c | 58 +++++++++++++++++++++++-------------
>>   drivers/gpu/drm/i915/intel_dp.c      |  8 +++--
>>   drivers/gpu/drm/i915/intel_drv.h     |  4 +--
>>   3 files changed, 45 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index ccb3e3f47450..7bf18658c659 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -7635,26 +7635,34 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
>>    * in cases where we need the PLL enabled even when @pipe is not going to
>>    * be enabled.
>>    */
>> -void vlv_force_pll_on(struct drm_device *dev, enum pipe pipe,
>> +int vlv_force_pll_on(struct drm_device *dev, enum pipe pipe,
>>   		      const struct dpll *dpll)
>>   {
>>   	struct intel_crtc *crtc =
>>   		to_intel_crtc(intel_get_crtc_for_pipe(dev, pipe));
>> -	struct intel_crtc_state pipe_config = {
>> -		.base.crtc = &crtc->base,
>> -		.pixel_multiplier = 1,
>> -		.dpll = *dpll,
>> -	};
>> +	struct intel_crtc_state *pipe_config;
>> +
>> +	pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
>> +	if (!pipe_config)
>> +		return -ENOMEM;
>
> tbh I wouldn't bother with the return code here since the only caller
> can't do anything about it anyway. But since this is a bit a bikeshed,
> either way:
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks!

First version actually did not bother with returning the error, but then 
I thought someone will be guaranteed to complain. :)

If it had more than one caller there would be some value in being able 
to report the error closer to the callsite, but like this is as you say.

However, being one of the rare patches which got a CI success I did not 
want to risk that and just merged it like it is. :)

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-20 10:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 15:25 [PATCH] drm/i915: Do not put big intel_crtc_state on the stack Tvrtko Ursulin
2016-01-19 16:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-01-19 20:22 ` [PATCH] " Daniel Vetter
2016-01-20 10:14   ` Tvrtko Ursulin [this message]
2016-01-21  9:47 ` Jani Nikula

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=569F5E22.7000901@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    /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).