diff options
author | Inki Dae <inki.dae@samsung.com> | 2014-12-02 22:05:01 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-06-08 17:56:43 +0900 |
commit | 3bdf6a624cd1225fa8fe2e6366ca6b63c8882c72 (patch) | |
tree | 1b277cbdbc6469781b779a8f963b9f41c8d2fd7d /drivers/gpu/drm/panel/panel-s6e63j0x03.c | |
parent | 6c0f62d75991cffb9f27e0e45a22e8ea4b06e7e7 (diff) | |
download | linux-3.10-tizen_LPD.tar.gz linux-3.10-tizen_LPD.tar.bz2 linux-3.10-tizen_LPD.zip |
drm/exynos: add LPD: Low Power Display mechanism supporttizen_LPD
The purpose of this mechanism is to transfer the only framebuffer
region updated by X server to Display panel to save power consumed
by Display relevant DMA devices.
Change-Id: I2589c617d817833011e761c9c8835e287ff2fb7c
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/panel/panel-s6e63j0x03.c')
-rw-r--r-- | drivers/gpu/drm/panel/panel-s6e63j0x03.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-s6e63j0x03.c index de7bdfa6615..3eb33cf8061 100644 --- a/drivers/gpu/drm/panel/panel-s6e63j0x03.c +++ b/drivers/gpu/drm/panel/panel-s6e63j0x03.c @@ -31,6 +31,9 @@ #define MCS_MTP_SET3 0xd4 #define MCS_MTP_KEY 0xf1 +#define LDI_CASET_REG 0x2A +#define LDI_PASET_REG 0x2B + #define MIN_BRIGHTNESS 0 #define MAX_BRIGHTNESS 100 #define DEFAULT_BRIGHTNESS 80 @@ -548,10 +551,45 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel) return 1; } +static int s6e63j0x03_change_resolution(struct drm_panel *panel, + unsigned int x, unsigned int y, + unsigned int w, unsigned int h) +{ + struct s6e63j0x03 *ctx = panel_to_s6e63j0x03(panel); + char buf[5]; + + if (ctx->power > FB_BLANK_UNBLANK) + return -EPERM; + + if (y >= ctx->vm.vactive || h > ctx->vm.vactive) + return -EINVAL; + + x += 20; + + buf[0] = LDI_CASET_REG; + buf[1] = (x & 0xff00) >> 8; + buf[2] = x & 0x00ff; + buf[3] = ((x + w - 1) & 0xff00) >> 8; + buf[4] = (x + w - 1) & 0x00ff; + + s6e63j0x03_dcs_write(ctx, buf, ARRAY_SIZE(buf)); + + buf[0] = LDI_PASET_REG; + buf[1] = (y & 0xff00) >> 8; + buf[2] = y & 0x00ff; + buf[3] = ((y + h - 1) & 0xff00) >> 8; + buf[4] = (y + h - 1) & 0x00ff; + + s6e63j0x03_dcs_write(ctx, buf, ARRAY_SIZE(buf)); + + return 0; +} + static const struct drm_panel_funcs s6e63j0x03_drm_funcs = { .disable = s6e63j0x03_disable, .enable = s6e63j0x03_enable, .get_modes = s6e63j0x03_get_modes, + .change_resolution = s6e63j0x03_change_resolution, }; static int s6e63j0x03_parse_dt(struct s6e63j0x03 *ctx) |