[PATCH 5/8] drm/mipi-dbi: Prepare framebuffer copy operation in pipe-update helpers

Thomas Zimmermann tzimmermann at suse.de
Fri Dec 2 11:50:37 UTC 2022


>>
>> You use drm_gem_fb_vmap() in the other places but here you access the
>> object directly (and in the next hunk), but again not so important since
>> it goes away in a later patch.
> 
> I'll update this patch to use drm_gem_fb_vmap() consistently.

And after looking at the impact and churn, I rather go with the existing 
code that initializes from the GEM DMA object.

Noralf, is there a reason why most of MIPI DBI uses DMA helpers? In 
terms of flexibility and resource consumption, wouldn't SHMEM helpers be 
a better fit?

Best regards
Thomas

> 
>>
>> With the comments considered:
>>
>> Reviewed-by: Noralf Trønnes <noralf at tronnes.org>
> 
> Thanks.
> 
> Best regards
> Thomas
> 
>>
>>>       if (drm_atomic_helper_damage_merged(old_state, state, &rect))
>>> -        st7586_fb_dirty(state->fb, &rect);
>>> +        st7586_fb_dirty(&src, fb, &rect);
>>>   }
>>>   static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,
>>> @@ -176,6 +181,8 @@ static void st7586_pipe_enable(struct 
>>> drm_simple_display_pipe *pipe,
>>>           .y1 = 0,
>>>           .y2 = fb->height,
>>>       };
>>> +    struct drm_gem_dma_object *dma_obj;
>>> +    struct iosys_map src;
>>>       int idx, ret;
>>>       u8 addr_mode;
>>> @@ -235,7 +242,10 @@ static void st7586_pipe_enable(struct 
>>> drm_simple_display_pipe *pipe,
>>>       msleep(100);
>>> -    st7586_fb_dirty(fb, &rect);
>>> +    dma_obj = drm_fb_dma_get_gem_obj(fb, 0);
>>> +    iosys_map_set_vaddr(&src, dma_obj->vaddr);
>>> +
>>> +    st7586_fb_dirty(&src, fb, &rect);
>>>       mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_ON);
>>>   out_exit:
>>> diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
>>> index 8c4ea7956d61d..36ac8495566b0 100644
>>> --- a/include/drm/drm_mipi_dbi.h
>>> +++ b/include/drm/drm_mipi_dbi.h
>>> @@ -13,9 +13,10 @@
>>>   #include <drm/drm_simple_kms_helper.h>
>>>   struct drm_rect;
>>> -struct spi_device;
>>>   struct gpio_desc;
>>> +struct iosys_map;
>>>   struct regulator;
>>> +struct spi_device;
>>>   /**
>>>    * struct mipi_dbi - MIPI DBI interface
>>> @@ -176,8 +177,9 @@ int mipi_dbi_command_read(struct mipi_dbi *dbi, 
>>> u8 cmd, u8 *val);
>>>   int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, 
>>> size_t len);
>>>   int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const 
>>> u8 *data,
>>>                     size_t len);
>>> -int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>>> +int mipi_dbi_buf_copy(void *dst, struct iosys_map *src, struct 
>>> drm_framebuffer *fb,
>>>                 struct drm_rect *clip, bool swap);
>>> +
>>>   /**
>>>    * mipi_dbi_command - MIPI DCS command with optional parameter(s)
>>>    * @dbi: MIPI DBI structure
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20221202/687c1e19/attachment.sig>


More information about the dri-devel mailing list