[RFC 1/3] atmel: drm: added drm driver for the atmel hlcd controller

Jean-Jacques Hiblot jjhiblot at traphandler.com
Sat Apr 19 12:03:10 PDT 2014


Thanks for the patch Robert.
I've just noticed that I actually worked with an old version of the
kernel (v3.14-rc3) when I thought it based on 3.15.

JJ

2014-04-18 16:31 GMT+02:00 Robert Nelson <robertcnelson at gmail.com>:
>
> On Fri, Apr 18, 2014 at 8:21 AM, Boris BREZILLON
> <boris.brezillon at free-electrons.com> wrote:
>> Hi JJ,
>>
>> On 18/04/2014 11:45, Jean-Jacques Hiblot wrote:
>>> +
>>> +static void update_scanout(struct drm_crtc *crtc)
>>> +{
>>> +     struct atmel_hlcdc_crtc *hlcdc_crtc = to_atmel_hlcdc_crtc(crtc);
>>> +     struct drm_device *dev = crtc->dev;
>>> +     struct atmel_hlcdc_drm_private *priv = dev->dev_private;
>>> +     struct drm_framebuffer *fb = crtc->fb;
>>> +
>>
>> I guess you meant
>>
>> struct drm_framebuffer *fb = hclcd_crtc->fb;
>>
>>
>> because otherwise you get an error when compiling (there are similar
>> issues below).
>
> This fixes this with v3.15-rc1
>
> diff --git a/drivers/gpu/drm/atmel_hlcdc/atmel_hlcdc_crtc.c
> b/drivers/gpu/drm/atmel_hlcdc/atmel_hlcdc_crtc.c
> index 649fa19..a111d69 100644
> --- a/drivers/gpu/drm/atmel_hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel_hlcdc/atmel_hlcdc_crtc.c
> @@ -81,7 +81,7 @@ static void update_scanout(struct drm_crtc *crtc)
>   struct atmel_hlcdc_crtc *hlcdc_crtc = to_atmel_hlcdc_crtc(crtc);
>   struct drm_device *dev = crtc->dev;
>   struct atmel_hlcdc_drm_private *priv = dev->dev_private;
> - struct drm_framebuffer *fb = crtc->fb;
> + struct drm_framebuffer *fb = crtc->primary->fb;
>
>   struct drm_gem_cma_object *gem;
>   struct atmel_hlcd_dma_desc *desc = hlcdc_crtc->dma_descs[DMA_BASE];
> @@ -188,7 +188,7 @@ static int atmel_hlcdc_crtc_page_flip(struct drm_crtc *crtc,
>   return -EBUSY;
>   }
>
> - crtc->fb = fb;
> + crtc->primary->fb = fb;
>   atmel_hlcdc_crtc->event = event;
>   update_scanout(crtc);
>   return 0;
> @@ -397,7 +397,7 @@ static int atmel_hlcdc_crtc_mode_set(struct drm_crtc *crtc,
>   hlcdc_write(dev, ATMEL_LCDC_BASECFG0,
>      LCDC_BASECFG0_BLEN_AHB_INCR16 | LCDC_BASECFG0_DLBO);
>
> - drm_fb_get_bpp_depth(crtc->fb->pixel_format, &depth, &bpp);
> + drm_fb_get_bpp_depth(crtc->primary->fb->pixel_format, &depth, &bpp);
>   hlcdc_write(dev, ATMEL_LCDC_BASECFG1,
>      atmel_hlcdfb_get_rgbmode(dev->dev, depth, bpp));
>   hlcdc_write(dev, ATMEL_LCDC_BASECFG2, 0);
>
> Tested-by: Robert Nelson <robertcnelson at gmail.com>
>
> digs out my 31/33/34, should have a patch for them in a bit...
>
> Regards,
>
> --
> Robert Nelson
> http://www.rcn-ee.com/


More information about the dri-devel mailing list