[Intel-gfx] [PATCH 3/8] drm/i915: Unclutter the get_plane() functions

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Oct 30 18:31:57 CET 2014


On 10/29/2014 05:22 PM, Damien Lespiau wrote:
> crtc->base.primary->fb was used everywhere. Use fb to temporarily point
> there and don't forget to assign fb to its final destination at the end.
>
> v2: Rebase on top of misc changes (mask of DSPSURF, PAGE_ALIGN)
>
> Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
> ---
>   drivers/gpu/drm/i915/intel_display.c | 61 ++++++++++++++++--------------------
>   1 file changed, 27 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2a84e47..6c042eb 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6459,9 +6459,10 @@ static void i9xx_get_plane_config(struct intel_crtc *crtc,
>   	int pipe = crtc->pipe, plane = crtc->plane;
>   	int fourcc, pixel_format;
>   	int aligned_height;
> +	struct drm_framebuffer *fb;
>
> -	crtc->base.primary->fb = kzalloc(sizeof(struct intel_framebuffer), GFP_KERNEL);
> -	if (!crtc->base.primary->fb) {
> +	fb = kzalloc(sizeof(struct intel_framebuffer), GFP_KERNEL);
> +	if (!fb) {
>   		DRM_DEBUG_KMS("failed to alloc fb\n");
>   		return;

Is it of any consequence that after the change crtc->base.primary->fb 
will preserve it's content, while previously it would be NULLed on 
allocation failure? Probably not, just asking...

Tvrtko




More information about the Intel-gfx mailing list