# lv_display_private.h (/api/private/display/lv_display_private_h)



<RelatedHeaders name="lv_display.h" isPrivate="true" />

<ApiSummary functions="1" structs="1" macros="2" />

Functions [#functions]

<ApiMember kind="function" name="lv_display_set_draw_buf_handlers" file="private/display/lv_display_private.h" line="206" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/display/lv_display_private.h#L206">
  lv_display_set_draw_buf_handlers [#lv_display_set_draw_buf_handlers]

  TODO(v10): rework the draw buffer abstraction so a buffer describes its own storage, and remove this.

  ```c title=" " lineNumbers=1
  void lv_display_set_draw_buf_handlers(lv_display_t *disp, const lv_draw_buf_handlers_t *handlers)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name       | Type                                                                               | Description                                             |
  | ---------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------- |
  | `disp`     | <ApiLink name="lv_display_t" display="lv_display_t *" />                           | pointer to a display                                    |
  | `handlers` | <ApiLink name="lv_draw_buf_handlers_t" display="const lv_draw_buf_handlers_t *" /> | the handlers to set on every draw buffer of the display |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="_lv_display_t">
  \_lv_display_t [#_lv_display_t]

  | Member                  | Type                                                       | Description                                                                                                                                                                                                                                                             |
  | ----------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `ext_data`              | <ApiLink name="lv_ext_data_t" />                           |                                                                                                                                                                                                                                                                         |
  | `hor_res`               | `int32_t`                                                  | Horizontal resolution.                                                                                                                                                                                                                                                  |
  | `ver_res`               | `int32_t`                                                  | Vertical resolution.                                                                                                                                                                                                                                                    |
  | `physical_hor_res`      | `int32_t`                                                  | Horizontal resolution of the full / physical display. Set to -1 for fullscreen mode.                                                                                                                                                                                    |
  | `physical_ver_res`      | `int32_t`                                                  | Vertical resolution of the full / physical display. Set to -1 for fullscreen mode.                                                                                                                                                                                      |
  | `offset_x`              | `int32_t`                                                  | Horizontal offset from the full / physical display. Set to 0 for fullscreen mode.                                                                                                                                                                                       |
  | `offset_y`              | `int32_t`                                                  | Vertical offset from the full / physical display. Set to 0 for fullscreen mode.                                                                                                                                                                                         |
  | `dpi`                   | `uint32_t`                                                 | DPI (dot per inch) of the display. Default value is `LV_DPI_DEF`.                                                                                                                                                                                                       |
  | `buf_1`                 | <ApiLink name="lv_draw_buf_t" display="lv_draw_buf_t *" /> |                                                                                                                                                                                                                                                                         |
  | `buf_2`                 | <ApiLink name="lv_draw_buf_t" display="lv_draw_buf_t *" /> |                                                                                                                                                                                                                                                                         |
  | `buf_3`                 | <ApiLink name="lv_draw_buf_t" display="lv_draw_buf_t *" /> |                                                                                                                                                                                                                                                                         |
  | `buf_act`               | <ApiLink name="lv_draw_buf_t" display="lv_draw_buf_t *" /> | Internal, used by the library                                                                                                                                                                                                                                           |
  | `flush_cb`              | <ApiLink name="lv_display_flush_cb_t" />                   | MANDATORY: Write the internal buffer (draw\_buf) to the display. '<ApiLink name="lv_display_flush_ready" display="lv_display_flush_ready()" />' has to be called when finished                                                                                          |
  | `flush_wait_cb`         | <ApiLink name="lv_display_flush_wait_cb_t" />              | Used to wait while flushing is ready. It can do any complex logic to wait, including semaphores, mutexes, polling flags, etc. If not set `flushing` flag is used which can be cleared with <ApiLink name="lv_display_flush_ready" display="lv_display_flush_ready()" /> |
  | `flushing`              | `volatile int`                                             | 1: flushing is in progress. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)                                                                                                                                            |
  | `flushing_last`         | `volatile int`                                             | 1: It was the last chunk to flush. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)                                                                                                                                     |
  | `last_area`             | `volatile uint32_t`                                        | 1: last area is being rendered                                                                                                                                                                                                                                          |
  | `last_part`             | `volatile uint32_t`                                        | 1: last part of the current area is being rendered                                                                                                                                                                                                                      |
  | `sync_cb`               | <ApiLink name="lv_display_sync_cb_t" />                    | Used to synchronize changes between frame buffers between renders. Called for each area needing to be synchronized before rendering next frame.                                                                                                                         |
  | `sync_wait_cb`          | <ApiLink name="lv_display_sync_wait_cb_t" />               | Used to wait while syncing is ready. It can do any complex logic to wait, including semaphores, mutexes, polling flags, etc. If not set `syncing` flag is used which can be cleared with <ApiLink name="lv_display_sync_ready" display="lv_display_sync_ready()" />     |
  | `syncing`               | `volatile int`                                             | 1: syncing is in progress. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)                                                                                                                                             |
  | `syncing_last`          | `volatile int`                                             | 1: It was the last chunk to sync. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)                                                                                                                                      |
  | `sync_areas`            | <ApiLink name="lv_ll_t" />                                 | Sync areas (redrawn during last refresh)                                                                                                                                                                                                                                |
  | `render_mode`           | <ApiLink name="lv_display_render_mode_t" />                |                                                                                                                                                                                                                                                                         |
  | `antialiasing`          | `uint32_t`                                                 | 1: anti-aliasing is enabled on this display.                                                                                                                                                                                                                            |
  | `tile_cnt`              | `uint32_t`                                                 | Divide the display buffer into these number of tiles                                                                                                                                                                                                                    |
  | `stride_is_auto`        | `uint32_t`                                                 | 1: The stride of the buffers was not set explicitly.                                                                                                                                                                                                                    |
  | `rendering_in_progress` | `uint32_t`                                                 | 1: The current screen rendering is in progress                                                                                                                                                                                                                          |
  | `color_format`          | <ApiLink name="lv_color_format_t" />                       |                                                                                                                                                                                                                                                                         |
  | `inv_areas`             | `lv_area_t[32]`                                            | Invalidated (marked to redraw) areas                                                                                                                                                                                                                                    |
  | `inv_area_joined`       | `uint8_t[32]`                                              |                                                                                                                                                                                                                                                                         |
  | `inv_p`                 | `uint32_t`                                                 |                                                                                                                                                                                                                                                                         |
  | `inv_en_cnt`            | `int32_t`                                                  |                                                                                                                                                                                                                                                                         |
  | `_static_buf1`          | <ApiLink name="lv_draw_buf_t" />                           | Used when user pass in a raw buffer as display draw buffer                                                                                                                                                                                                              |
  | `_static_buf2`          | <ApiLink name="lv_draw_buf_t" />                           |                                                                                                                                                                                                                                                                         |
  | `layer_head`            | <ApiLink name="lv_layer_t" display="lv_layer_t *" />       |                                                                                                                                                                                                                                                                         |
  | `screens`               | <ApiLink name="lv_obj_t" display="lv_obj_t **" />          | Screens of the display Array of screen objects.                                                                                                                                                                                                                         |
  | `sys_layer`             | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           |                                                                                                                                                                                                                                                                         |
  | `top_layer`             | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           |                                                                                                                                                                                                                                                                         |
  | `act_scr`               | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | Currently active screen on this display                                                                                                                                                                                                                                 |
  | `bottom_layer`          | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           |                                                                                                                                                                                                                                                                         |
  | `prev_scr`              | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | Previous screen. Used during screen animations                                                                                                                                                                                                                          |
  | `scr_to_load`           | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | The screen prepared to load in lv\_screen\_load\_anim                                                                                                                                                                                                                   |
  | `screen_cnt`            | `uint32_t`                                                 |                                                                                                                                                                                                                                                                         |
  | `draw_prev_over_act`    | `uint8_t`                                                  |                                                                                                                                                                                                                                                                         |
  | `del_prev`              | `uint8_t`                                                  | 1: Draw previous screen over active screen                                                                                                                                                                                                                              |
  | `driver_data`           | `void *`                                                   | 1: Automatically delete the previous screen when the screen load animation is ready Custom user data                                                                                                                                                                    |
  | `user_data`             | `void *`                                                   | Custom user data                                                                                                                                                                                                                                                        |
  | `event_list`            | <ApiLink name="lv_event_list_t" />                         |                                                                                                                                                                                                                                                                         |
  | `rotation`              | `uint32_t`                                                 | Element of lv\_display\_rotation\_t                                                                                                                                                                                                                                     |
  | `matrix_rotation`       | `uint32_t`                                                 | 1: Use matrix for display rotation                                                                                                                                                                                                                                      |
  | `theme`                 | <ApiLink name="lv_theme_t" display="lv_theme_t *" />       | The theme assigned to the screen                                                                                                                                                                                                                                        |
  | `refr_timer`            | <ApiLink name="lv_timer_t" display="lv_timer_t *" />       | A timer which periodically checks the dirty areas and refreshes them                                                                                                                                                                                                    |
  | `last_activity_time`    | `uint32_t`                                                 | Last time when there was activity on this display                                                                                                                                                                                                                       |
  | `refreshed_area`        | <ApiLink name="lv_area_t" />                               | The area being refreshed                                                                                                                                                                                                                                                |
  | `vsync_count`           | `uint32_t`                                                 |                                                                                                                                                                                                                                                                         |
  | `perf_label`            | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           |                                                                                                                                                                                                                                                                         |
  | `perf_sysmon_backend`   | <ApiLink name="lv_sysmon_backend_data_t" />                |                                                                                                                                                                                                                                                                         |
  | `perf_sysmon_info`      | <ApiLink name="lv_sysmon_perf_info_t" />                   |                                                                                                                                                                                                                                                                         |
  | `mem_label`             | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           |                                                                                                                                                                                                                                                                         |
</ApiMember>

<TypeUsedBy name="_lv_display_t" count="1">
  * `lv_indev_set_display` — param `disp`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LOG_NULL_DISPLAY_DEPRECATED_MESSAGE" file="private/display/lv_display_private.h" line="23" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/display/lv_display_private.h#L23">
  LOG_NULL_DISPLAY_DEPRECATED_MESSAGE [#log_null_display_deprecated_message]

  ```c title=" " lineNumbers=1
  #define LOG_NULL_DISPLAY_DEPRECATED_MESSAGE() \
      LV_LOG_DEPRECATED("Calling this function with a NULL display is deprecated. You can retrieve the default display with `lv_display_get_default()`")
  ```
</ApiMember>

<ApiMember kind="macro" name="LV_INV_BUF_SIZE" file="private/display/lv_display_private.h" line="30" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/display/lv_display_private.h#L30">
  LV_INV_BUF_SIZE [#lv_inv_buf_size]

  ```c title=" " lineNumbers=1
  #define LV_INV_BUF_SIZE 32
  ```

  Buffer size for invalid areas
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lvgl_public.h&#x22;, &#x22;lv_event_private.h&#x22;, &#x22;lv_sysmon_private.h&#x22;]" includedBy="[&#x22;lv_draw_ppa.h&#x22;, &#x22;lv_draw_ppa_private.h&#x22;, &#x22;lv_draw_pxp.h&#x22;, &#x22;lvgl_private.h&#x22;]" transitiveIncludes="[&#x22;lv_array.h&#x22;]" />
