1. 07 Jun, 2024 4 commits
    • Noralf Trønnes's avatar
      drm/mipi-dbi: Add support for DRM_FORMAT_RGB888 · 4aebb790
      Noralf Trønnes authored
      DRM_FORMAT_RGB888 is 24 bits per pixel and it would be natural to send it
      on the SPI bus using a 24 bits per word transfer. The problem with this
      is that not all SPI controllers support 24 bpw.
      
      Since DRM_FORMAT_RGB888 is stored in memory as little endian and the SPI
      bus is big endian we use 8 bpw to always get the same pixel format on the
      bus: b8g8r8.
      
      The MIPI DCS specification lists the standard commands that can be sent
      over the MIPI DBI interface. The set_address_mode (36h) command has one
      bit in the parameter that controls RGB/BGR order. This means that the
      controller can be configured to receive the pixel as BGR.
      
      RGB888 is rarely supported on these controllers but RGB666 is very common.
      All datasheets I have seen do at least support the pixel format option
      where each color is sent as one byte and the 6 MSB's are used.
      
      All this put together means that we can send each pixel as b8g8r8 and an
      RGB666 capable controller sees this as b6x2g6x2r6x2.
      
      v4:
      - s/emulation_format/pixel_format/ (Dmitry)
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240604-panel-mipi-dbi-rgb666-v4-4-d7c2bcb9b78d@tronnes.orgSigned-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      4aebb790
    • Noralf Trønnes's avatar
      drm/mipi-dbi: Make bits per word configurable for pixel transfers · df3fb27a
      Noralf Trønnes authored
      MIPI DCS write/set commands have 8 bit parameters except for the
      write_memory commands where it depends on the pixel format.
      drm_mipi_dbi does currently only support RGB565 which is 16-bit and it
      has to make sure that the pixels enters the SPI bus in big endian format
      since the MIPI DBI spec doesn't have support for little endian.
      
      drm_mipi_dbi is optimized for DBI interface option 3 which means that the
      16-bit bytes are swapped by the upper layer if the SPI bus does not
      support 16 bits per word, signified by the swap_bytes member.
      
      In order to support both 16-bit and 24-bit pixel transfers we need a way
      to tell the DBI command layer the format of the buffer. Add a
      write_memory_bpw member that the upper layer can use to tell how many
      bits per word to use for the SPI transfer.
      
      v4:
      - Expand the commit message (Dmitry)
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240604-panel-mipi-dbi-rgb666-v4-3-d7c2bcb9b78d@tronnes.orgSigned-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      df3fb27a
    • Noralf Trønnes's avatar
      drm/mipi-dbi: Remove mipi_dbi_machine_little_endian() · f34f014c
      Noralf Trønnes authored
      mipi_dbi_machine_little_endian() should really have been called
      mipi_dbi_framebuffer_little_endian() because that's the function it
      performs. When I added support for these SPI displays I thought that the
      framebuffers on big endian machines were also big endian, but I have
      later learned that this is not the case. There's a bit in the fourcc code
      that controls this: DRM_FORMAT_BIG_ENDIAN.
      
      Just remove the function to avoid confusion. We can add big endian support
      later should the need arise and we have hardware to test on.
      
      Instead of just amending the docs, expand it to explain the endianness
      handling.
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240604-panel-mipi-dbi-rgb666-v4-2-d7c2bcb9b78d@tronnes.orgSigned-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      f34f014c
    • Noralf Trønnes's avatar
      dt-bindings: display: panel: mipi-dbi-spi: Add a pixel format property · fdb16466
      Noralf Trønnes authored
      The MIPI DBI 2.0 specification (2005) lists only two pixel formats for
      the Type C Interface (SPI) and that is 3-bits/pixel RGB111 with
      2 options for bit layout.
      
      For Type A and B (parallel) the following formats are listed: RGB332,
      RGB444, RGB565, RGB666 and RGB888 (some have 2 options for the bit layout).
      
      Many MIPI DBI compatible controllers support all interface types on the
      same chip and often the manufacturers have chosen to provide support for
      the Type A/B interface pixel formats also on the Type C interface.
      
      Some chips provide many pixel formats with optional bit layouts over SPI,
      but the most common by far are RGB565 and RGB666. So even if the
      specification doesn't list these formats for the Type C interface, the
      industry has chosen to include them.
      
      The MIPI DCS specification lists the standard commands that can be sent
      over the MIPI DBI interface. The set_address_mode (36h) command has one
      bit in the parameter that controls RGB/BGR order:
          This bit controls the RGB data latching order transferred from the
          peripheral’s frame memory to the display device.
      This means that each supported RGB format also has a BGR variant.
      
      Based on this rationale document the following pixel formats describing
      the bit layout going over the wire:
      - RGB111 (option 1): x2r1g1b1r1g1b1 (2 pixels per byte)
      - BGR111 (option 1): x2b1g1r1b1g1r1 (2 pixels per byte)
      - RGB111 (option 2): x1r1g1b1x1r1g1b1 (2 pixels per byte)
      - BGR111 (option 2): x1b1g1r1x1b1g1r1 (2 pixels per byte)
      - RGB565: r5g6b5 (2 bytes)
      - BGR565: b5g6r5 (2 bytes)
      - RGB666: r6x2g6x2b6x2 (3 bytes)
      - BGR666: b6x2g6x2r6x2 (3 bytes)
      (x: don't care)
      
      v2:
      - Use 'default: r5g6b5' (Rob)
      Reviewed-by: default avatarRob Herring (Arm) <robh@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240604-panel-mipi-dbi-rgb666-v4-1-d7c2bcb9b78d@tronnes.orgSigned-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
      fdb16466
  2. 06 Jun, 2024 16 commits
  3. 05 Jun, 2024 2 commits
  4. 04 Jun, 2024 3 commits
  5. 03 Jun, 2024 3 commits
  6. 31 May, 2024 1 commit
  7. 30 May, 2024 9 commits
  8. 29 May, 2024 2 commits