On 3/15/26 6:28 PM, David Lechner wrote:
> On 3/11/26 5:10 AM, Thomas Zimmermann wrote:
>> Refactor the existing simple-display callbacks such that they invoke
>> helpers compatible with regular atomic modesetting. Allows for adding
>> mipi-dbi drives that do not require simple-display helpers. Provide
>> initializer macro for elements of the regular modesetting pipeline.
>>
>> As the new helpers are DRM functions, add the drm_ prefix. Mipi-dbi
>> interfaces currently lack this.
>>
> 



>>  static const struct drm_mode_config_helper_funcs 
>> mipi_dbi_mode_config_helper_funcs = {
>> -    .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
>> +    DRM_MIPI_DBI_MODE_CONFIG_HELPER_FUNCS,
>>  };
>>  
>>  static const struct drm_mode_config_funcs mipi_dbi_mode_config_funcs = {
>> -    .fb_create = drm_gem_fb_create_with_dirty,
>> -    .atomic_check = drm_atomic_helper_check,
>> -    .atomic_commit = drm_atomic_helper_commit,
>> +    DRM_MIPI_DBI_MODE_CONFIG_FUNCS,
>>  };
>>  
>>  static const uint32_t mipi_dbi_formats[] = {
>> -    DRM_FORMAT_RGB565,
>> -    DRM_FORMAT_XRGB8888,
>> +    DRM_MIPI_DBI_PLANE_FORMATS,
>>  };
> 
> Why adding these macros? They are only used once, so it seems like it
> just makes the code harder to read (one more place you have to jump to).
> 
> Maybe this is common style in drm or something?

I should have kept reading the next patches before I hit send.

It would have helped if the commit message mentioned why we are doing
this and not just what we are doing.

> 
>>  
>>  /**
>> @@ -633,8 +707,7 @@ int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev 
>> *dbidev,
>>                                 unsigned int rotation, size_t tx_buf_size)
>>  {
>>      static const uint64_t modifiers[] = {
>> -            DRM_FORMAT_MOD_LINEAR,
>> -            DRM_FORMAT_MOD_INVALID
>> +            DRM_MIPI_DBI_PLANE_FORMAT_MODIFIERS,
>>      };
>>      struct drm_device *drm = &dbidev->drm;
>>      int ret;

Reply via email to