Skip to content

Conversation

@andysan
Copy link
Contributor

@andysan andysan commented Jul 27, 2022

Overview

All UC81xx devices support partial refresh by only scanning a subset (window) of the display. However, there is currently no way to specify different configuration overrides for different refresh types (full/partial). Having this capability makes it possible to implement fast (differential) partial refresh if the vendor provides suitable LUTs. This pull request addresses that by introducing different refresh profiles in the device tree.

It consists of the following major changes:

  • Minor cleanups
  • drivers: uc81xx: Specify overrides in a DT child node
  • drivers: uc81xx: Add a separate partial refresh profile
  • Support for more types of overrides (LUTs/PLL/VDCs)
  • drivers: uc81xx: Add workaround for chips without autocopy
  • shields: Add a GDEW042T2 with fast partial refresh (fast partial refresh example)

Add support for separate refresh profiles

Add support for separate partial and full refresh profiles. This makes it possible to specify different parameters for full and partial refreshes. The design is similar to the proposed design for the SSD16XX (#48163). However, unlike the SSD16xx, the driver always supports partial refresh even if a partial refresh profile hasn't been provided. This seems like the best option for this chip as it always supports scanning of a subset of the display.

Devices that need custom LUTs and voltages can specify them separately for the full and partial profiles. The controller will be reset when changing profiles which means that profiles always override the default reset values. This means that it is, for example, possible to use default values and LUTs from OTP for a full refresh and a custom profile for partial refreshes.

Differences between UC8176 and UC8179

UC8176 and UC8179 seem to handle frame buffers differently. According to the specification, UC8179 is capable of automatically copying from the current frame buffer to the old frame buffer. This is usually not a problem for most full refresh profiles since they tend to not perform differential refresh. However, when performing a fast differential refresh, it's necessary to maintain both frame buffers correctly. The UC8176 requires manual updates of the old frame buffer. This is enabled if the auto_copy quirk is set to false.

Testing

This has so far only been tested on a GDEW042T2. I don't own any boards using any other UltraChip controllers, so I would really appreciate it if someone with access to a GDEW075T7 could test this driver.

Open questions

Partial refresh specification in device tree

The current version of the patch assumes that a device that doesn't have a partial refresh node implements partial refresh with using the default configuration (the reset values) in the controller. This is different from the model in SSD16XX.

There are roughly possible approaches when no refresh profile has been specified in the device tree:

  1. Never perform any type of partial refresh. This is what the current patch for the SSD16xx does.
  2. Treat it as an empty refresh profile in the device tree. I.e., use the controller's default configuration. Current implementation in this PR.
  3. Use the settings from the full refresh profile, but only scan the refresh window. This is similar to the old behaviour.

I'm leaning towards updating the PR to use option 3 instead of option 2. Option 1 seems like a poor fit for this controller since it always supports a partial display refresh.

@andysan
Copy link
Contributor Author

andysan commented Aug 15, 2022

@jfischer-no Any thoughts on how a missing partial refresh profile should be treated? Is the current approach acceptable? Or should I just use the settings from the full refresh profile (if present) and just scan the partial window?

@jfischer-no
Copy link
Contributor

I would really appreciate it if someone with access to a GDEW075T7 could test this driver.

Tested, I do not see any regressions.

@jfischer-no Any thoughts on how a missing partial refresh profile should be treated? Is the current approach acceptable? Or should I just use the settings from the full refresh profile (if present) and just scan the partial window?

+1 for "Use the settings from the full refresh profile, but only scan the refresh window. This is similar to the old behaviour."

The UC81xx driver prints a debug message on every iteration of its
busy wait loop. This makes debug output almost useless. Modify this
code to print a debug message on entry and exit instead.

Signed-off-by: Andreas Sandberg <[email protected]>
Some commands need to signal that the chip is busy using the busy
pin. We generally need to wait for the chip to exit the busy state
before issuing a new command. Call uc81xx_busy_wait() from
uc81xx_write_cmd() just before issuing a new command instead to avoid
sprinkling wait calls everywhere.

Signed-off-by: Andreas Sandberg <[email protected]>
Introduce the concept of refresh profiles which are specified as a
child node in the device tree. This makes it possible to use different
overrides for different types of refreshes (full/partial).

The only profile that is currently supported is the "full" profile.

Signed-off-by: Andreas Sandberg <[email protected]>
Add a separate profile for partial refreshes. This makes it possible
to specify a separate refresh configuration for partial and full
refreshes.

The driver now transitions to full refresh mode when blanking is
turned on. It transitions back to partial refresh mode when there is a
write while blanking is off.

Signed-off-by: Andreas Sandberg <[email protected]>
Add support for overriding display LUTs in the UC81xx driver. This
makes it possible to use different LUTs for the full and partial
refresh profiles.

Signed-off-by: Andreas Sandberg <[email protected]>
Some custom refresh profiles need to set the PLL and VDCS
registers. Add them as optional DT properties.

Signed-off-by: Andreas Sandberg <[email protected]>
The UC8176 doesn't automatically copy writes to the buffer containing
the old SRAM contents. In this case, we need to manually copy data to
the back buffer.

Signed-off-by: Andreas Sandberg <[email protected]>
Add GoodDisplay GDEW042T2 with fast partial refresh. Based on
configuration from GoodDisplay's Arduino example.

Signed-off-by: Andreas Sandberg <[email protected]>
galak
galak previously requested changes Aug 16, 2022
Copy link
Contributor

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove label prop

@jfischer-no jfischer-no requested a review from galak August 17, 2022 09:27
@jfischer-no jfischer-no added this to the v3.2.0 milestone Sep 2, 2022
@carlescufi carlescufi merged commit fd62b9f into zephyrproject-rtos:main Sep 2, 2022
@andysan andysan deleted the uc81xx-partial-v3 branch September 2, 2022 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants