CABC patch list
Subsystems (3)
v3 cover CABC patch list
CABC stands for the Content Adaptive Backlight Control.
In the normal display the backlight which we see is due to the backlight which is being modulated by the filter, which is inturn dependent on the image. In brief the CABC does the histogram analysis of the image and then controls the filter and backlight. For example in CABC to display the dark image the backlight is dimmed and then controlls the filter to allow more light, because of which is power consuption will be reduced.
Below are the inital set of patches which supports the CABC. A field exits in the mipi configuration of the VBT which when enabled indiactes the CABC is supported. Depending on this filed the backlight control function pointer are initalized in the intel_panel.c file.
In case of dual link panels depending on the panel the DCS commands have to be send to either PORT A, PORT C or both PORT A and PORT C. Again a filed is added in the VBT to get this data from the version 197 onwards. One of the below patches parses these fields from the VBT.
v3:
- removed the first patch from the list as it was not necessary
- addressed Daniel and Gaurav`s comments.
Deepak M (2):
drm/i915: Parsing the PWM cntrl and CABC ON/OFF fileds in VBT drm/i915: CABC support for backlight control
drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_bios.c | 13 +++++++++++++ drivers/gpu/drm/i915/intel_bios.h | 5 ++++- drivers/gpu/drm/i915/intel_dsi.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/intel_dsi.h | 2 ++ drivers/gpu/drm/i915/intel_panel.c | 23 +++++++++++++++++++---- include/video/mipi_display.h | 8 ++++++++ 7 files changed, 62 insertions(+), 8 deletions(-)
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH v3 1/2 drm/i915: Parsing the PWM cntrl and CABC ON/OFF fileds in VBT
For dual link panel scenarios there are new fileds added in the VBT which indicate on which port the PWM cntrl and CABC ON/OFF commands needs to be sent.
v2: Rebase
v3: Rebase
--- drivers/gpu/drm/i915/intel_bios.c | 13 +++++++++++++ drivers/gpu/drm/i915/intel_bios.h | 5 ++++- drivers/gpu/drm/i915/intel_dsi.h | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_bios.c +13 -0
@@ -789,6 +789,19 @@ parse_mipi(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)return ; } +/* +* These below bits will inform us on which port the panel blk_cntrl and +* CABC ON/OFF commands needs to be sent in case of dual link panels +* u16 dl_cabc_port:2; +* u16 pwm_bkl_ctrl:2; +* But these are introduced from the VBT version 197 onwards, so making +* sure that these bits are zero in the pervious versions. +*/ +if (dev_priv->vbt.dsi.config->dual_link && bdb->version <197 ) { + dev_priv->vbt.dsi.config->dl_cabc_port =0 ; + dev_priv->vbt.dsi.config->pwm_bkl_ctrl =0 ; + } +/* We have mandatory mipi config blocks. Initialize as generic panel */ dev_priv->vbt.dsi.panel_id =MIPI_DSI_GENERIC_PANEL_ID ;
drivers/gpu/drm/i915/intel_bios.h +4 -1
@@ -834,7 +834,10 @@ struct mipi_config { u16 dual_link:2; u16 lane_cnt:2; u16 pixel_overlap:3; - u16 rsvd3:9; + u16 rgb_flip:1; + u16 dl_cabc_port:2; + u16 pwm_bkl_ctrl:2; + u16 rsvd3:4;u16 rsvd4;
drivers/gpu/drm/i915/intel_dsi.h +2 -0
@@ -74,6 +74,8 @@ struct intel_dsi {u8 escape_clk_div;u8 dual_link; +u8 dl_cabc_port; +u8 pwm_blk_ctrl;u8 pixel_overlap;u32 port_bits;u32 bw_timer;
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH v3 2/2 drm/i915: CABC support for backlight control
In reply to Deepak MIn CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
v3:
- Use for_each_dsi_port macro for handling port C also (Gaurav)
- Rebase
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/intel_panel.c | 23 +++++++++++++++++++---- include/video/mipi_display.h | 8 ++++++++ 4 files changed, 43 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/Makefile +1 -0
@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \ intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \
drivers/gpu/drm/i915/intel_dsi.c +15 -3
@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;
@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi->attached_connector); }static void intel_dsi_pre_enable (struct intel_encoder *encoder)
@@ -458,12 +462,17 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)static void intel_dsi_pre_disable (struct intel_encoder *encoder) { +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else +intel_panel_disable_backlight (intel_dsi->attached_connector);if (is_vid_mode (intel_dsi)) {/* Send Shutdown command to the panel in LP mode */
@@ -1133,7 +1142,10 @@ void intel_dsi_init(struct drm_device *dev) }intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;
drivers/gpu/drm/i915/intel_panel.c +19 -4
@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333
@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel)void intel_backlight_register (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector); +else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }
include/video/mipi_display.h +8 -0
@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , +MIPI_DCS_CABC_CONTROL_RD =0x56 , +MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53, };/* MIPI DCS pixel formats */
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
Quoted 8 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
Quoted 6 lines
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
I don't know what Daniel's been telling you, but I think this does need to get bolted into the regular backlight control mechanism. We'll also need eDP specific backlight control, and there's the VLV/CVH pwm driver absed backlight control, so we need to cover this more gracefully than an if-else ladder anyway.
My idea all along has been that the backlight hooks in dev_priv.display need to be moved to connectors (probably intel_panel), and connector backlight setup can do what they want with these. All the boilerplate code for sysfs and scaling and so on would be there already.
I do not approve of the approach here.
BR,
Jani.
Quoted 151 lines
v3:
- Usefor_each_dsi_portmacro for handling port C also (Gaurav)
- RebaseSigned-off-by Deepak M <[email protected]>--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/intel_panel.c | 23 +++++++++++++++++++---- include/video/mipi_display.h | 8 ++++++++ 4 files changed, 43 insertions(+), 7 deletions(-)drivers/gpu/drm/i915/Makefile +1
-0@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \ intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \drivers/gpu/drm/i915/intel_dsi.c +15
-3@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi->attached_connector); }static void intel_dsi_pre_enable (struct intel_encoder *encoder)@@ -458,12 +462,17 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)static void intel_dsi_pre_disable (struct intel_encoder *encoder) { +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else +intel_panel_disable_backlight (intel_dsi->attached_connector);if (is_vid_mode (intel_dsi)) {/* Send Shutdown command to the panel in LP mode */ @@ -1133,7 +1142,10 @@ void intel_dsi_init(struct drm_device *dev) }intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;drivers/gpu/drm/i915/intel_panel.c +19
-4@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel)void intel_backlight_register (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector); +else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }include/video/mipi_display.h +8
-0@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , +MIPI_DCS_CABC_CONTROL_RD =0x56 , +MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53, };/* MIPI DCS pixel formats */ Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
Quoted 22 lines · Jani Nikula
Quoted 8 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
Quoted 6 lines
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)I don't know what Daniel's been telling you, but I think this does need to get bolted into the regular backlight control mechanism. We'll also need eDP specific backlight control, and there's the VLV/CVH pwm driver absed backlight control, so we need to cover this more gracefully than an if-else ladder anyway.
Quoted 6 lines
My idea all along has been that the backlight hooks in dev_priv.display need to be moved to connectors (probably
intel_panel), and connector backlight setup can do what they want with these. All the boilerplate code for sysfs and scaling and so on would be there already.I do not approve of the approach here.
The current design of backlights in linux is that userspace picks the right backlight device. We've enabled/disabled the backlight pwm ourselves too, but that was always just for the native backlight power thing, not any of the others.
Imo this is the right approach since it fits into the current design. Fixing the current design so that i915 can get at the right backlight driver should imo be a separate series. I.e. yes this is what I recommended roughly (but I didn't check details nor can I test with xf86-video-intel to make sure it actually works correctly). -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Jani Nikula
Quoted 8 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
Quoted 6 lines
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)I don't know what Daniel's been telling you, but I think this does need to get bolted into the regular backlight control mechanism. We'll also need eDP specific backlight control, and there's the VLV/CVH pwm driver absed backlight control, so we need to cover this more gracefully than an if-else ladder anyway.
My idea all along has been that the backlight hooks in dev_priv.display need to be moved to connectors (probably
intel_panel), and connector backlight setup can do what they want with these. All the boilerplate code for sysfs and scaling and so on would be there already.
Quoted 6 lines
Quoted 1 line
I do not approve of the approach here.
The current design of backlights in linux is that userspace picks the right backlight device. We've enabled/disabled the backlight pwm ourselves too, but that was always just for the native backlight power thing, not any of the others.
What does that have to do with this series?
Quoted 1 line
Imo this is the right approach since it fits into the current design.
No, it does *not* fit into the current design, which you can see from the if ladders there.
Quoted 4 lines
Fixing the current design so that i915 can get at the right backlight driver should imo be a separate series. I.e. yes this is what I recommended roughly (but I didn't check details nor can I test with xf86-video-intel to make sure it actually works correctly).
It is important this gets done the right way up front, because there's now two series in flight to rip up the backlight code that's now neat and tidy.
I am *not* volunteering to clean up the backlight code again. I've already done it once.
BR,
Jani.
Quoted 5 lines
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
Quoted 48 lines · Jani Nikula
Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Jani Nikula
Quoted 8 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
Quoted 6 lines
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)I don't know what Daniel's been telling you, but I think this does need to get bolted into the regular backlight control mechanism. We'll also need eDP specific backlight control, and there's the VLV/CVH pwm driver absed backlight control, so we need to cover this more gracefully than an if-else ladder anyway.
My idea all along has been that the backlight hooks in dev_priv.display need to be moved to connectors (probably
intel_panel), and connector backlight setup can do what they want with these. All the boilerplate code for sysfs and scaling and so on would be there already.Quoted 6 lines
Quoted 1 line
I do not approve of the approach here.
The current design of backlights in linux is that userspace picks the right backlight device. We've enabled/disabled the backlight pwm ourselves too, but that was always just for the native backlight power thing, not any of the others.
What does that have to do with this series?
Quoted 1 line
Imo this is the right approach since it fits into the current design.
No, it does *not* fit into the current design, which you can see from the if ladders there.
Quoted 4 lines
Fixing the current design so that i915 can get at the right backlight driver should imo be a separate series. I.e. yes this is what I recommended roughly (but I didn't check details nor can I test with xf86-video-intel to make sure it actually works correctly).
Quoted 6 lines
It is important this gets done the right way up front, because there's now two series in flight to rip up the backlight code that's now neat and tidy.
I am *not* volunteering to clean up the backlight code again. I've already done it once.
Here's how you can actually do this nicely [1].
BR,
Jani.
[1] http://mid.gmane.org/[email protected]
Quoted 13 lines
BR,
Jani.Quoted 5 lines
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
In reply to Jani NikulaQuoted 36 lines · Jani Nikula
Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Jani Nikula
Quoted 8 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
Quoted 6 lines
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)I don't know what Daniel's been telling you, but I think this does need to get bolted into the regular backlight control mechanism. We'll also need eDP specific backlight control, and there's the VLV/CVH pwm driver absed backlight control, so we need to cover this more gracefully than an if-else ladder anyway.
My idea all along has been that the backlight hooks in dev_priv.display need to be moved to connectors (probably
intel_panel), and connector backlight setup can do what they want with these. All the boilerplate code for sysfs and scaling and so on would be there already.Quoted 6 lines
Quoted 1 line
I do not approve of the approach here.
The current design of backlights in linux is that userspace picks the right backlight device. We've enabled/disabled the backlight pwm ourselves too, but that was always just for the native backlight power thing, not any of the others.
Quoted 6 lines
What does that have to do with this series?
Quoted 1 line
Imo this is the right approach since it fits into the current design.
No, it does *not* fit into the current design, which you can see from the if ladders there.
Well those if ladders are partially breaking the current design, we've never done that for any of the other backlight drivers. For those userspace is expected to call them before a modeset.
Adding if ladders to the kernel is probably not needed if userspace holds up it's part of the deal.
Quoted 11 lines
Quoted 4 lines
Fixing the current design so that i915 can get at the right backlight driver should imo be a separate series. I.e. yes this is what I recommended roughly (but I didn't check details nor can I test with xf86-video-intel to make sure it actually works correctly).
It is important this gets done the right way up front, because there's now two series in flight to rip up the backlight code that's now neat and tidy.
I am *not* volunteering to clean up the backlight code again. I've already done it once.
This isn't about cleaning up the i915 backlight code, it's about pulling the backlight selection logic from libbacklight into the kernel. At least for the if ladders in the encoder enable/disable hooks. I assumed that neither for capc and for the edp dpcd backlight we'd need those (userspace should frob the backlight for us).
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
Quoted 60 lines · Daniel Vetter
Quoted 36 lines · Jani Nikula
Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Jani Nikula
Quoted 8 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
Quoted 6 lines
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)I don't know what Daniel's been telling you, but I think this does need to get bolted into the regular backlight control mechanism. We'll also need eDP specific backlight control, and there's the VLV/CVH pwm driver absed backlight control, so we need to cover this more gracefully than an if-else ladder anyway.
My idea all along has been that the backlight hooks in dev_priv.display need to be moved to connectors (probably
intel_panel), and connector backlight setup can do what they want with these. All the boilerplate code for sysfs and scaling and so on would be there already.Quoted 6 lines
Quoted 1 line
I do not approve of the approach here.
The current design of backlights in linux is that userspace picks the right backlight device. We've enabled/disabled the backlight pwm ourselves too, but that was always just for the native backlight power thing, not any of the others.
Quoted 6 lines
What does that have to do with this series?
Quoted 1 line
Imo this is the right approach since it fits into the current design.
No, it does *not* fit into the current design, which you can see from the if ladders there.
Well those if ladders are partially breaking the current design, we've never done that for any of the other backlight drivers. For those userspace is expected to call them before a modeset.
Adding if ladders to the kernel is probably not needed if userspace holds up it's part of the deal.
Quoted 9 lines
Quoted 4 lines
Fixing the current design so that i915 can get at the right backlight driver should imo be a separate series. I.e. yes this is what I recommended roughly (but I didn't check details nor can I test with xf86-video-intel to make sure it actually works correctly).
It is important this gets done the right way up front, because there's now two series in flight to rip up the backlight code that's now neat and tidy.
Quoted 8 lines
Quoted 2 lines
I am *not* volunteering to clean up the backlight code again. I've already done it once.
This isn't about cleaning up the i915 backlight code, it's about pulling the backlight selection logic from libbacklight into the kernel. At least for the if ladders in the encoder enable/disable hooks. I assumed that neither for capc and for the edp dpcd backlight we'd need those (userspace should frob the backlight for us).
I can't be bothered to summarize the rather frustrated IRC discussion on this, but the bottom line is that the kernel implementation should be done using the backlight hooks approach I suggested in [1]. That does not exclude the possibility of exposing more backlight interfaces if needed, but it keeps the kernel implementation neat.
BR,
Jani.
[1] http://mid.gmane.org/[email protected]
Quoted 5 lines
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
In reply to Deepak MQuoted 31 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
v3:
- Usefor_each_dsi_portmacro for handling port C also (Gaurav)
- RebaseSigned-off-by Deepak M <[email protected]>--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/intel_panel.c | 23 +++++++++++++++++++---- include/video/mipi_display.h | 8 ++++++++ 4 files changed, 43 insertions(+), 7 deletions(-)drivers/gpu/drm/i915/Makefile +0
-0
drivers/gpu/drm/i915/Makefile i915-y += dvo_ch7017.o \ · line 85
Quoted 4 lines
drivers/gpu/drm/i915/Makefile +1
-0@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \
You've forgotten to git add intel_dsi_cabc.c. Makes reviewing things a bit hard ;-)
-Daniel
Quoted 130 lines
drivers/gpu/drm/i915/Makefile +0
-0intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \drivers/gpu/drm/i915/intel_dsi.c +15
-3@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi->attached_connector); }static void intel_dsi_pre_enable (struct intel_encoder *encoder)@@ -458,12 +462,17 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)static void intel_dsi_pre_disable (struct intel_encoder *encoder) { +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else +intel_panel_disable_backlight (intel_dsi->attached_connector);if (is_vid_mode (intel_dsi)) {/* Send Shutdown command to the panel in LP mode */ @@ -1133,7 +1142,10 @@ void intel_dsi_init(struct drm_device *dev) }intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;drivers/gpu/drm/i915/intel_panel.c +19
-4@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel)void intel_backlight_register (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector); +else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }include/video/mipi_display.h +8
-0@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , +MIPI_DCS_CABC_CONTROL_RD =0x56 , +MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53, };/* MIPI DCS pixel formats */ Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight control
Quoted 38 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, September 14, 2015 3:12 PM
To: Deepak, M
Cc: [email protected]
Subject: Re: [Intel-gfx] [RFC CABC v3 PATCH 2/2] drm/i915: CABC support for backlight controlQuoted 26 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
v3:
- Usefor_each_dsi_portmacro for handling port C also (Gaurav)
- RebaseSigned-off-by Deepak M <[email protected]>--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +++++++++++++++--- drivers/gpu/drm/i915/intel_panel.c | 23 +++++++++++++++++++---- include/video/mipi_display.h | 8 ++++++++ 4 files changed, 43 insertions(+), 7 deletions(-)
Quoted 12 lines
drivers/gpu/drm/i915/Makefile i915-y += dvo_ch7017.o \ · line 85
Quoted 9 lines
(quoted diff) +0
-0b/drivers/gpu/drm/i915/Makefile index 44d290a..d87c690 100644
drivers/gpu/drm/i915/Makefile +1
-0@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \You've forgotten to git add
intel_dsi_cabc.c. Makes reviewing things a bit hard ;-) -Daniel
[Deepak M] Extremely sorry, git am didn't worked had did patch -p1 but got forgot to do a git am :), will update the patch.
Quoted 133 lines
drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_enable(struct intel_encoder
Quoted 18 lines
drivers/gpu/drm/i915/Makefile +0
-0intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \drivers/gpu/drm/i915/intel_dsi.c +1
-0@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder*encoder)
Quoted 30 lines
drivers/gpu/drm/i915/intel_dsi.c +4
-1intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi- attached_connector); }static void
intel_dsi_pre_enable(struct intel_encoder *encoder)@@
-458,12 +462,17 @@ static voidintel_dsi_enable_nop(struct intel_encoder *encoder)static void
intel_dsi_pre_disable(struct intel_encoder *encoder){drivers/gpu/drm/i915/intel_dsi.c +6
-1+struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else + intel_panel_disable_backlight(intel_dsi-
attached_connector);drivers/gpu/drm/i915/intel_dsi.c
Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi.c +0
-0if (is_vid_mode (intel_dsi)) { /* Send Shutdown command to the panel in LP mode */ @@ -1133,7
Quoted 26 lines
+1142,10 @@ void
intel_dsi_init(struct drm_device *dev)drivers/gpu/drm/i915/intel_dsi.c +4
-1}intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;drivers/gpu/drm/i915/intel_panel.c +1
-0@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333drivers/gpu/drm/i915/intel_panel.c void intel_panel_fini(struct intel_panel · line 1589
Quoted 5 lines
drivers/gpu/drm/i915/intel_panel.c +1
-1@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel) void intel_backlight_register(struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; - list_for_each_entry(connector, &dev->mode_config.connector_list,base.head)
Quoted 6 lines
drivers/gpu/drm/i915/intel_panel.c +5
-1-intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector);drivers/gpu/drm/i915/intel_panel.c void intel_panel_fini(struct intel_panel *panel)
Quoted 10 lines
drivers/gpu/drm/i915/intel_panel.c +4
-1+else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; - list_for_each_entry(connector, &dev->mode_config.connector_list,base.head)
Quoted 32 lines
drivers/gpu/drm/i915/intel_panel.c +8
-1-intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }(quoted diff) +0
-0
b/include/video/mipi_display.hindex ddcc8ca..5b8eeec 100644include/video/mipi_display.h +8
-1@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , +MIPI_DCS_CABC_CONTROL_RD =0x56 , +MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53, };/* MIPI DCS pixel formats */ --1.7.9.5
Quoted 9 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 drm/i915: CABC support for backlight control
In reply to Daniel VetterIn CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
v3:
- Use for_each_dsi_port macro for handling port C also (Gaurav)
- Rebase
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +- drivers/gpu/drm/i915/intel_dsi_cabc.c | 310 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi_cabc.h | 46 +++++ drivers/gpu/drm/i915/intel_panel.c | 23 ++- include/video/mipi_display.h | 8 + 6 files changed, 399 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_dsi_cabc.c create mode 100644 drivers/gpu/drm/i915/intel_dsi_cabc.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \ intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \
drivers/gpu/drm/i915/intel_dsi.c +15 -3
@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;
@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi->attached_connector); }static void intel_dsi_pre_enable (struct intel_encoder *encoder)
@@ -458,12 +462,17 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)static void intel_dsi_pre_disable (struct intel_encoder *encoder) { +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else +intel_panel_disable_backlight (intel_dsi->attached_connector);if (is_vid_mode (intel_dsi)) {/* Send Shutdown command to the panel in LP mode */
@@ -1133,7 +1142,10 @@ void intel_dsi_init(struct drm_device *dev) }intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +310 -0
310 lines not on this page · raw message
drivers/gpu/drm/i915/intel_dsi_cabc.h new file +46 -0
46 lines not on this page · raw message
drivers/gpu/drm/i915/intel_panel.c +19 -4
@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333
@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel)void intel_backlight_register (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector); +else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }
include/video/mipi_display.h +8 -0
@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , +MIPI_DCS_CABC_CONTROL_RD =0x56 , +MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53, };/* MIPI DCS pixel formats */
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [PATCH] drm/i915: CABC support for backlight control
Quoted 10 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
I think CABC is a confusing name for this. At the high level, this should be called, say, DCS backlight control. I think CABC is a special case of backlight control in the DSI panel; there are panels with brightness control via DCS *without* CABC.
See further comments inline.
Quoted 45 lines
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
v3:
- Usefor_each_dsi_portmacro for handling port C also (Gaurav)
- RebaseSigned-off-by Deepak M <[email protected]>--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +- drivers/gpu/drm/i915/intel_dsi_cabc.c | 310 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi_cabc.h | 46 +++++ drivers/gpu/drm/i915/intel_panel.c | 23 ++- include/video/mipi_display.h | 8 + 6 files changed, 399 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_dsi_cabc.c create mode 100644 drivers/gpu/drm/i915/intel_dsi_cabc.hdrivers/gpu/drm/i915/Makefile +1
-0@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \ intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \drivers/gpu/drm/i915/intel_dsi.c +1
-0@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;
drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_enable(struct intel_encoder *encoder) · line 405
Quoted 8 lines
drivers/gpu/drm/i915/intel_dsi.c +4
-1@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi->attached_connector);
See my patch at [1] for how I think all of this should be handled.
Quoted 114 lines
drivers/gpu/drm/i915/intel_dsi.c +10
-2}static void intel_dsi_pre_enable (struct intel_encoder *encoder)@@ -458,12 +462,17 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)static void intel_dsi_pre_disable (struct intel_encoder *encoder) { +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else +intel_panel_disable_backlight (intel_dsi->attached_connector);if (is_vid_mode (intel_dsi)) {/* Send Shutdown command to the panel in LP mode */ @@ -1133,7 +1142,10 @@ void intel_dsi_init(struct drm_device *dev) }intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;drivers/gpu/drm/i915/intel_dsi_cabc.c new file +74
-0@@ -0,0 +1,310 @@ +/* +* Copyright © 2006-2010 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* Author: Deepak M <[email protected]> +*/ + +#include <linux/kernel.h> +#include <linux/moduleparam.h> +#include "intel_drv.h" +#include "intel_dsi.h" +#include "i915_drv.h" +#include "intel_dsi_cabc.h" +#include <video/mipi_display.h> +#include <drm/drm_mipi_dsi.h> + +static inline enum port get_cabc_port (struct intel_dsi *intel_dsi) +{ +if (intel_dsi->dl_cabc_port ==CABC_PORT_C ) +return PORT_C ; +else +return PORT_A ; +} + +int cabc_setup_backlight (struct drm_connector *connector, +enum pipe unused) +{ +struct drm_device *dev = connector->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_connector *intel_connector =to_intel_connector (connector); +struct intel_panel *panel = &intel_connector->panel; + +if (dev_priv->vbt.backlight.present) + panel->backlight.present = true; +else { +DRM_ERROR ("no backlight present per VBT\n" ); +return 0 ; + } + + panel->backlight.max =CABC_MAX_VALUE ; + panel->backlight.level =CABC_MAX_VALUE ; + +return 0 ; +} + +u32 cabc_get_backlight (struct intel_connector *connector) +{ +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct mipi_dsi_device *dsi_device; +u8 data[2 ] = {0 }; +enum port port; +u32 ret; +
drivers/gpu/drm/i915/intel_dsi_cabc.c line 84
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +10
-0+list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi =enc_to_intel_dsi (&encoder->base); +break ; + } + } +if (intel_dsi !=NULL ) +break ; + }
You can get at intel_dsi via connector->encoder. No need for this kind of loops.
Same for similar loops below.
drivers/gpu/drm/i915/intel_dsi_cabc.c line 96
Quoted 12 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +12
-0+ +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + + dsi_device = intel_dsi->dsi_hosts[port]->device; +mipi_dsi_dcs_read (dsi_device,MIPI_DCS_CABC_LEVEL_RD , data,2 ); + +if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==CABC_PORT_A_AND_C )) +break ; + }
That is a really confusing way to do the dcs command on one or more ports. How about making dl_cabc_port (hopefully renamed to something referring to dcs rather than cabc) a bitmap of ports similar to intel_dsi->ports, so you can make this loop simply:
for_each_dsi_port(port, dcs_backlight_ports)
...There'd be no need for special casing and conditional breaks out of the loop or anything.
Same for similar loops below.
Quoted 318 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +214
-0+ + ret = data[1 ]; + +return ret; +} + +void cabc_set_backlight (struct intel_connector *connector,u32 level) +{ +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct mipi_dsi_device *dsi_device; +u8 data[2 ] = {0 }; +enum port port; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi =enc_to_intel_dsi (&encoder->base); +break ; + } + } +if (intel_dsi !=NULL ) +break ; + } + +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + + dsi_device = intel_dsi->dsi_hosts[port]->device; + data[1 ] = level; + data[0 ] =MIPI_DCS_CABC_LEVEL_WR ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + +if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==CABC_PORT_A_AND_C )) +break ; + } +} + +void cabc_enable_backlight (struct intel_connector *connector) +{ +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct intel_panel *panel = &connector->panel; +struct mipi_dsi_device *dsi_device; +enum port port; +u8 data[2 ] = {0 }; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi =enc_to_intel_dsi (&encoder->base); +break ; + } + } +if (intel_dsi !=NULL ) +break ; + } + +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + + dsi_device = intel_dsi->dsi_hosts[port]->device; + data[0 ] =MIPI_DCS_CABC_CONTROL_BRIGHT_WR ; + data[1 ] =CABC_BACKLIGHT |CABC_DIMMING_DISPLAY |CABC_BCTRL ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + data[0 ] =MIPI_DCS_CABC_CONTROL_WR ; + data[1 ] =CABC_STILL_PICTURE ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + +if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==CABC_PORT_A_AND_C )) +break ; + } + +cabc_set_backlight (connector, panel->backlight.level); +} + +void cabc_disable_backlight (struct intel_connector *connector) +{ +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct mipi_dsi_device *dsi_device; +enum port port; +u8 data[2 ] = {0 }; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi =enc_to_intel_dsi (&encoder->base); +break ; + } + } +if (intel_dsi !=NULL ) +break ; + } + +cabc_set_backlight (connector,0 ); + +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + dsi_device = intel_dsi->dsi_hosts[port]->device; + + data[1 ] =CABC_OFF ; + data[0 ] =MIPI_DCS_CABC_CONTROL_WR ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + data[0 ] =MIPI_DCS_CABC_CONTROL_BRIGHT_WR ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + +if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==CABC_PORT_A_AND_C )) +break ; + } +} +static int cabc_backlight_device_update_status (struct backlight_device *bd) +{ +struct intel_connector *connector =bl_get_data (bd); +struct drm_device *dev = connector->base.dev; + +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); +DRM_DEBUG_KMS ("updating intel_backlight, brightness=%d/%d\n" , + bd->props.brightness, bd->props.max_brightness); + +cabc_set_backlight (connector, bd->props.brightness); + +drm_modeset_unlock (&dev->mode_config.connection_mutex); + +return 0 ; +} + +static int cabc_backlight_device_get_brightness (struct backlight_device *bd) +{ +struct intel_connector *connector =bl_get_data (bd); +struct drm_device *dev = connector->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +int ret; + +intel_runtime_pm_get (dev_priv); +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); + + ret =cabc_get_backlight (connector); + +drm_modeset_unlock (&dev->mode_config.connection_mutex); +intel_runtime_pm_put (dev_priv); + +return ret; +} + +static const struct backlight_ops cabc_backlight_device_ops = { + .update_status = cabc_backlight_device_update_status, + .get_brightness = cabc_backlight_device_get_brightness, +}; + +int cabc_backlight_device_register (struct intel_connector *connector) +{ +struct intel_panel *panel = &connector->panel; +struct backlight_properties props; + +if (WARN_ON (panel->backlight.device)) +return -ENODEV ; + +if (!panel->backlight.present) { +DRM_ERROR ("No backlight present\n" ); +return 0 ; + } + +WARN_ON (panel->backlight.max ==0 ); + +memset (&props,0 ,sizeof (props)); + props.type =BACKLIGHT_FIRMWARE ; + props.max_brightness = panel->backlight.max; + props.brightness = props.max_brightness; + +/* +* Note: using the same name independent of the connector prevents +* registration of multiple backlight devices in the driver. +*/ + panel->backlight.device = +backlight_device_register ("intel_backlight" , + connector->base.kdev, + connector, + &cabc_backlight_device_ops, &props); + +if (IS_ERR (panel->backlight.device)) { +DRM_ERROR ("Failed to register backlight: %ld\n" , +PTR_ERR (panel->backlight.device)); + panel->backlight.device =NULL ; +return -ENODEV ; + } + +DRM_DEBUG_KMS ("Connector %s backlight sysfs interface registered\n" , + connector->base.name); + +return 0 ; +} + +void cabc_backlight_device_unregister (struct intel_connector *connector) +{ +struct intel_panel *panel = &connector->panel; + +if (panel->backlight.device) { +backlight_device_unregister (panel->backlight.device); + panel->backlight.device =NULL ; + } +}drivers/gpu/drm/i915/intel_dsi_cabc.h new file +46
-0@@ -0,0 +1,46 @@ +/* +* Copyright © 2013 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* Author: Deepak M <[email protected]> +*/ + +extern int cabc_backlight_device_register (struct intel_connector *connector); +extern void cabc_backlight_device_unregister (struct intel_connector *connector); +void cabc_set_backlight (struct intel_connector *connector,u32 level); +u32 cabc_get_backlight (struct intel_connector *connector); +void cabc_enable_backlight (struct intel_connector *connector); +void cabc_disable_backlight (struct intel_connector *connector); +int cabc_setup_backlight (struct drm_connector *connector,enum pipe unused); + +#define CABC_OFF (0 << 0) +#define CABC_USER_INTERFACE_IMAGE (1 << 0) +#define CABC_STILL_PICTURE (2 << 0) +#define CABC_VIDEO_MODE (3 << 0) + +#define CABC_BACKLIGHT (1 << 2) +#define CABC_DIMMING_DISPLAY (1 << 3) +#define CABC_BCTRL (1 << 5) + +#define CABC_PORT_A 0x00 +#define CABC_PORT_C 0x01 +#define CABC_PORT_A_AND_C 0x02 +#define CABC_MAX_VALUE 0xffdrivers/gpu/drm/i915/intel_panel.c +19
-4@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel)void intel_backlight_register (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector); +else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; -list_for_each_entry (connector, &dev->mode_config.connector_list, base.head) -intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }include/video/mipi_display.h +0
-0@@ -117,6 +117,14 @@ enum { MIPI_DCS_GET_SCANLINE = 0x45,
include/video/mipi_display.h enum { · line 127
Quoted 10 lines
include/video/mipi_display.h +8
-0MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , +MIPI_DCS_CABC_CONTROL_RD =0x56 , +MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53,
These changes need to be a separate patch. And what's the spec reference, I can't find these.
BR,
Jani.
Quoted 10 lines
include/video/mipi_display.h +0
-0};/* MIPI DCS pixel formats */ Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: CABC support for backlight control
Quoted 88 lines
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Monday, September 14, 2015 5:51 PM
To: Deepak, M; [email protected]
Cc: Deepak, M
Subject: Re: [Intel-gfx] [PATCH] drm/i915: CABC support for backlight controlQuoted 10 lines · Deepak M
In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness.
The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control.
In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness.
I think CABC is a confusing name for this. At the high level, this should be called, say, DCS backlight control. I think CABC is a special case of backlight control in the DSI panel; there are panels with brightness control via DCS *without* CABC.
See further comments inline.
Quoted 8 lines
v2:
- Created a new backlight driver for cabc, which will be registered only when it cabc is supported by panel. (Daniel Vetter)
v3:
- Usefor_each_dsi_portmacro for handling port C also (Gaurav)
- RebaseQuoted 5 lines
Signed-off-by Deepak M <[email protected]>--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi.c | 18 +- drivers/gpu/drm/i915/intel_dsi_cabc.c | 310+++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_enable(struct intel_encoder
Quoted 33 lines
drivers/gpu/drm/i915/intel_dsi_cabc.h | 46 +++++ drivers/gpu/drm/i915/intel_panel.c | 23 ++- include/video/mipi_display.h | 8 + 6 files changed, 399 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_dsi_cabc.c create mode 100644 drivers/gpu/drm/i915/intel_dsi_cabc.h(quoted diff) +0
-0b/drivers/gpu/drm/i915/Makefile index 44d290a..d87c690 100644
drivers/gpu/drm/i915/Makefile +1
-0@@ -82,6 +82,7 @@ i915-y += dvo_ch7017.o \ intel_dsi.o \ intel_dsi_panel_vbt.o \ intel_dsi_pll.o \ + intel_dsi_cabc.o \ intel_dvo.o \ intel_hdmi.o \ intel_i2c.o \drivers/gpu/drm/i915/intel_dsi.c +1
-0@@ -35,6 +35,7 @@#include "i915_drv.h" #include "intel_drv.h" #include "intel_dsi.h" +#include "intel_dsi_cabc.h" static const struct { u16 panel_id;@@ -398,7 +399,10 @@ static void intel_dsi_enable(struct intel_encoder*encoder)
drivers/gpu/drm/i915/intel_dsi.c static void intel_dsi_enable(struct intel_encoder *encoder)
Quoted 9 lines
drivers/gpu/drm/i915/intel_dsi.c +4
-1intel_dsi_port_enable (encoder); } -intel_panel_enable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_enable_backlight (intel_dsi->attached_connector); +else +intel_panel_enable_backlight (intel_dsi- attached_connector);See my patch at [1] for how I think all of this should be handled.
Quoted 2 lines
[Deepak M] Will go through that patch.
Quoted 138 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_dsi.c +0
-0}static void
intel_dsi_pre_enable(struct intel_encoder *encoder)@@
-458,12 +462,17 @@ static voidintel_dsi_enable_nop(struct intel_encoder *encoder)static void
intel_dsi_pre_disable(struct intel_encoder *encoder){drivers/gpu/drm/i915/intel_dsi.c +6
-1+struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private;struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;DRM_DEBUG_KMS ("\n" ); -intel_panel_disable_backlight (intel_dsi->attached_connector); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_disable_backlight (intel_dsi->attached_connector); +else + intel_panel_disable_backlight(intel_dsi-
attached_connector);drivers/gpu/drm/i915/intel_dsi.c
Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi.c +0
-0if (is_vid_mode (intel_dsi)) { /* Send Shutdown command to the panel in LP mode */ @@ -1133,7
Quoted 31 lines
+1142,10 @@ void
intel_dsi_init(struct drm_device *dev)drivers/gpu/drm/i915/intel_dsi.c +4
-1}intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); -intel_panel_setup_backlight (connector,INVALID_PIPE ); +if (dev_priv->vbt.dsi.config->cabc_supported) +cabc_setup_backlight (connector,INVALID_PIPE ); +else +intel_panel_setup_backlight (connector,INVALID_PIPE );return ;drivers/gpu/drm/i915/intel_dsi_cabc.c new file +12
-0@@ -0,0 +1,310 @@ +/* +* Copyright © 2006-2010 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person +obtaining a +* copy of this software and associated documentation files (the +"Software"), +* to deal in the Software without restriction, including without +limitation +* the rights to use, copy, modify, merge, publish, distribute, +sublicense, +* and/or sell copies of the Software, and to permit persons to whom drivers/gpu/drm/i915/intel_dsi_cabc.c line 22
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +10
-0+the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including +the next + * paragraph) shall be included in all copies or substantial portions +of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANYKIND,
drivers/gpu/drm/i915/intel_dsi_cabc.c line 26
Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +4
-0+EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY , + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NOEVENT
drivers/gpu/drm/i915/intel_dsi_cabc.c line 28
Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +2
-0+SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES
drivers/gpu/drm/i915/intel_dsi_cabc.c line 32
Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +4
-0+OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USEOR
Quoted 17 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +17
-0+OTHER +* DEALINGS IN THE SOFTWARE. +* +* Author: Deepak M <[email protected]> */ + +#include <linux/kernel.h> +#include <linux/moduleparam.h> +#include "intel_drv.h" +#include "intel_dsi.h" +#include "i915_drv.h" +#include "intel_dsi_cabc.h" +#include <video/mipi_display.h> +#include <drm/drm_mipi_dsi.h> + +static inline enum port get_cabc_port (struct intel_dsi *intel_dsi) { +if (intel_dsi->dl_cabc_port ==CABC_PORT_C ) +return PORT_C ;drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +10
-0+else +return PORT_A ; +} + +int cabc_setup_backlight (struct drm_connector *connector, +enum pipe unused) +{ +struct drm_device *dev = connector->dev; +struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_connector *intel_connector =
to_intel_connector(connector);Quoted 31 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +29
-0+struct intel_panel *panel = &intel_connector->panel; + +if (dev_priv->vbt.backlight.present) + panel->backlight.present = true; +else { +DRM_ERROR ("no backlight present per VBT\n" ); +return 0 ; + } + + panel->backlight.max =CABC_MAX_VALUE ; + panel->backlight.level =CABC_MAX_VALUE ; + +return 0 ; +} + +u32 cabc_get_backlight (struct intel_connector *connector) { +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct mipi_dsi_device *dsi_device; +u8 data[2 ] = {0 }; +enum port port; +u32 ret; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi = enc_to_intel_dsi(&encoder-base);
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +1
-0+break ;
Quoted 9 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c line 84
Quoted 5 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +5
-0+ } + } +if (intel_dsi !=NULL ) +break ; + }You can get at
intel_dsiviaconnector->encoder. No need for this kind of loops.
[Deepak M] Okay
Quoted 22 lines
Same for similar loops below.
drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 7 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +7
-0+ +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + + dsi_device = intel_dsi->dsi_hosts[port]->device; + mipi_dsi_dcs_read(dsi_device, MIPI_DCS_CABC_LEVEL_RD,data, 2);
drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 3 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +3
-0+ + if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==
CABC_PORT_A_AND_C))drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +2
-0+break ; + }That is a really confusing way to do the dcs command on one or more ports. How about making
dl_cabc_port(hopefully renamed to something referring to dcs rather than cabc) a bitmap of ports similar tointel_dsi->ports, so you can make this loop simply:
Quoted 8 lines
for_each_dsi_port(port, dcs_backlight_ports) ...There'd be no need for special casing and conditional breaks out of the loop or anything.
Same for similar loops below.
[Deepak M] Nice, will try to implement this way
Quoted 347 lines
Quoted 62 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +20
-0+ + ret = data[1 ]; + +return ret; +} + +void cabc_set_backlight (struct intel_connector *connector,u32 level) +{ +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct mipi_dsi_device *dsi_device; +u8 data[2 ] = {0 }; +enum port port; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi = enc_to_intel_dsi(&encoder-base);
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +36
-0+break ; + } + } +if (intel_dsi !=NULL ) +break ; + } + +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + + dsi_device = intel_dsi->dsi_hosts[port]->device; + data[1 ] = level; + data[0 ] =MIPI_DCS_CABC_LEVEL_WR ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + +if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==CABC_PORT_A_AND_C )) +break ; + } +} + +void cabc_enable_backlight (struct intel_connector *connector) { +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct intel_panel *panel = &connector->panel; +struct mipi_dsi_device *dsi_device; +enum port port; +u8 data[2 ] = {0 }; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi = enc_to_intel_dsi(&encoder-base);
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +4
-0+break ; + } + } +if (intel_dsi !=NULL )drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +10
-0+break ; + } + +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi); + + dsi_device = intel_dsi->dsi_hosts[port]->device; + data[0 ] =MIPI_DCS_CABC_CONTROL_BRIGHT_WR ; + data[1] = CABC_BACKLIGHT | CABC_DIMMING_DISPLAY |
CABC_BCTRL;drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 7 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +7
-0+mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + data[0 ] =MIPI_DCS_CABC_CONTROL_WR ; + data[1 ] =CABC_STILL_PICTURE ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + + if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==
CABC_PORT_A_AND_C))Quoted 31 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +18
-0+break ; + } + +cabc_set_backlight (connector, panel->backlight.level); } + +void cabc_disable_backlight (struct intel_connector *connector) { +struct drm_device *dev = connector->base.dev; +struct intel_dsi *intel_dsi =NULL ; +struct drm_crtc *crtc =NULL ; +struct intel_encoder *encoder =NULL ; +struct mipi_dsi_device *dsi_device; +enum port port; +u8 data[2 ] = {0 }; + +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { +for_each_encoder_on_crtc (dev, crtc, encoder) { +if (encoder->type ==INTEL_OUTPUT_DSI ) { + intel_dsi = enc_to_intel_dsi(&encoder-base);
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +12
-0+break ; + } + } +if (intel_dsi !=NULL ) +break ; + } + +cabc_set_backlight (connector,0 ); + +for_each_dsi_port (port, intel_dsi->ports) { +if (intel_dsi->dual_link) + port =get_cabc_port (intel_dsi);drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +10
-0+ dsi_device = intel_dsi->dsi_hosts[port]->device; + + data[1 ] =CABC_OFF ; + data[0 ] =MIPI_DCS_CABC_CONTROL_WR ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + data[0 ] =MIPI_DCS_CABC_CONTROL_BRIGHT_WR ; +mipi_dsi_dcs_write_buffer (dsi_device, data,2 ); + + if (intel_dsi->dual_link && + !(intel_dsi->dl_cabc_port ==
CABC_PORT_A_AND_C))Quoted 70 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +70
-0+break ; + } +} +static int cabc_backlight_device_update_status (struct +backlight_device *bd) { +struct intel_connector *connector =bl_get_data (bd); +struct drm_device *dev = connector->base.dev; + +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); +DRM_DEBUG_KMS ("updating intel_backlight, brightness=%d/%d\n" , + bd->props.brightness, bd->props.max_brightness); + +cabc_set_backlight (connector, bd->props.brightness); + +drm_modeset_unlock (&dev->mode_config.connection_mutex); + +return 0 ; +} + +static int cabc_backlight_device_get_brightness (struct +backlight_device *bd) { +struct intel_connector *connector =bl_get_data (bd); +struct drm_device *dev = connector->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +int ret; + +intel_runtime_pm_get (dev_priv); +drm_modeset_lock (&dev->mode_config.connection_mutex,NULL ); + + ret =cabc_get_backlight (connector); + +drm_modeset_unlock (&dev->mode_config.connection_mutex); +intel_runtime_pm_put (dev_priv); + +return ret; +} + +static const struct backlight_ops cabc_backlight_device_ops = { + .update_status = cabc_backlight_device_update_status, + .get_brightness = cabc_backlight_device_get_brightness, +}; + +int cabc_backlight_device_register (struct intel_connector *connector) +{ +struct intel_panel *panel = &connector->panel; +struct backlight_properties props; + +if (WARN_ON (panel->backlight.device)) +return -ENODEV ; + +if (!panel->backlight.present) { +DRM_ERROR ("No backlight present\n" ); +return 0 ; + } + +WARN_ON (panel->backlight.max ==0 ); + +memset (&props,0 ,sizeof (props)); + props.type =BACKLIGHT_FIRMWARE ; + props.max_brightness = panel->backlight.max; + props.brightness = props.max_brightness; + +/* +* Note: using the same name independent of the connector prevents +* registration of multiple backlight devices in the driver. +*/ + panel->backlight.device = + backlight_device_register("intel_backlight", + connector->base.kdev, + connector,drivers/gpu/drm/i915/intel_dsi_cabc.c
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +10
-0+ &cabc_backlight_device_ops, &props); + +if (IS_ERR (panel->backlight.device)) { +DRM_ERROR ("Failed to register backlight: %ld\n" , +PTR_ERR (panel->backlight.device)); + panel->backlight.device =NULL ; +return -ENODEV ; + } + + DRM_DEBUG_KMS("Connector %s backlight sysfs interfaceregistered\n",
Quoted 33 lines
drivers/gpu/drm/i915/intel_dsi_cabc.c new file +14
-0+ connector->base.name); + +return 0 ; +} + +void cabc_backlight_device_unregister (struct intel_connector +*connector) { +struct intel_panel *panel = &connector->panel; + +if (panel->backlight.device) { +backlight_device_unregister (panel->backlight.device); + panel->backlight.device =NULL ; + } +}drivers/gpu/drm/i915/intel_dsi_cabc.h new file +12
-0@@ -0,0 +1,46 @@ +/* +* Copyright © 2013 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person +obtaining a +* copy of this software and associated documentation files (the +"Software"), +* to deal in the Software without restriction, including without +limitation +* the rights to use, copy, modify, merge, publish, distribute, +sublicense, +* and/or sell copies of the Software, and to permit persons to whom drivers/gpu/drm/i915/intel_dsi_cabc.h line 22
Quoted 10 lines
drivers/gpu/drm/i915/intel_dsi_cabc.h new file +10
-0+the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including +the next + * paragraph) shall be included in all copies or substantial portions +of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANYKIND,
drivers/gpu/drm/i915/intel_dsi_cabc.h line 26
Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi_cabc.h new file +4
-0+EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY , + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NOEVENT
drivers/gpu/drm/i915/intel_dsi_cabc.h line 28
Quoted 2 lines
drivers/gpu/drm/i915/intel_dsi_cabc.h new file +2
-0+SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES
drivers/gpu/drm/i915/intel_dsi_cabc.h line 32
Quoted 4 lines
drivers/gpu/drm/i915/intel_dsi_cabc.h new file +4
-0+OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USEOR
Quoted 42 lines
drivers/gpu/drm/i915/intel_dsi_cabc.h new file +28
-0+OTHER +* DEALINGS IN THE SOFTWARE. +* +* Author: Deepak M <[email protected]> */ + +extern int cabc_backlight_device_register (struct intel_connector +*connector);extern void cabc_backlight_device_unregister (struct +intel_connector *connector);void cabc_set_backlight (struct +intel_connector *connector,u32 level); +u32 cabc_get_backlight (struct intel_connector *connector);void +cabc_enable_backlight (struct intel_connector *connector);void +cabc_disable_backlight (struct intel_connector *connector);int +cabc_setup_backlight (struct drm_connector *connector,enum pipe +unused); + +#define CABC_OFF (0 << 0) +#define CABC_USER_INTERFACE_IMAGE (1 << 0) +#define CABC_STILL_PICTURE (2 << 0) +#define CABC_VIDEO_MODE (3 << 0) + +#define CABC_BACKLIGHT (1 << 2) +#define CABC_DIMMING_DISPLAY (1 << 3) +#define CABC_BCTRL (1 << 5) + +#define CABC_PORT_A 0x00 +#define CABC_PORT_C 0x01 +#define CABC_PORT_A_AND_C 0x02 +#define CABC_MAX_VALUE 0xffdrivers/gpu/drm/i915/intel_panel.c +1
-0@@ -34,6 +34,7 @@#include <linux/moduleparam.h> #include <linux/pwm.h> #include "intel_drv.h" +#include "intel_dsi_cabc.h" #define CRC_PMIC_PWM_PERIOD_NS 21333drivers/gpu/drm/i915/intel_panel.c void intel_panel_fini(struct intel_panel · line 1589
Quoted 5 lines
drivers/gpu/drm/i915/intel_panel.c +1
-1@@ -1586,15 +1587,29 @@ void intel_panel_fini(struct intel_panel *panel) void intel_backlight_register(struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; - list_for_each_entry(connector, &dev->mode_config.connector_list,base.head)
Quoted 6 lines
drivers/gpu/drm/i915/intel_panel.c +5
-1-intel_backlight_device_register (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_register (connector);drivers/gpu/drm/i915/intel_panel.c void intel_panel_fini(struct intel_panel *panel)
Quoted 10 lines
drivers/gpu/drm/i915/intel_panel.c +4
-1+else +intel_backlight_device_register (connector); + } }void intel_backlight_unregister (struct drm_device *dev) {struct intel_connector *connector; +struct drm_i915_private *dev_priv = dev->dev_private; - list_for_each_entry(connector, &dev->mode_config.connector_list,base.head)
Quoted 21 lines
drivers/gpu/drm/i915/intel_panel.c +8
-1-intel_backlight_device_unregister (connector); +list_for_each_entry (connector, &dev->mode_config.connector_list, + base.head) { +if (connector->encoder->type ==INTEL_OUTPUT_DSI && + dev_priv->vbt.dsi.config->cabc_supported) +cabc_backlight_device_unregister (connector); +else +intel_backlight_device_unregister (connector); + } }(quoted diff) +0
-0
b/include/video/mipi_display.hindex ddcc8ca..5b8eeec 100644include/video/mipi_display.h +3
-0@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , + MIPI_DCS_CABC_CONTROL_RD = 0x56,
Quoted 9 lines
include/video/mipi_display.h enum { · line 127
Quoted 5 lines
include/video/mipi_display.h +5
-0+MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53,These changes need to be a separate patch. And what's the spec reference, I can't find these.
[Deepak M] The HLD can be found in the link https://securewiki.ith.intel.com/display/GfxDisplay/MIPI+Display (it is under Intel firewall)
Quoted 10 lines
BR,
Jani.Quoted 6 lines
include/video/mipi_display.h +0
-1};/* MIPI DCS pixel formats */ --1.7.9.5
Quoted 7 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [PATCH] drm/i915: CABC support for backlight control
Quoted 28 lines · On Mon, 14 Sep 2015, "Deepak, M" <[email protected]> wrote:
Quoted 19 lines
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Monday, September 14, 2015 5:51 PM
To: Deepak, M; [email protected]
Cc: Deepak, M
Subject: Re: [Intel-gfx] [PATCH] drm/i915: CABC support for backlight controlQuoted 11 lines · Deepak M
(quoted diff) +0
-0
b/include/video/mipi_display.hindex ddcc8ca..5b8eeec 100644include/video/mipi_display.h +3
-0@@ -117,6 +117,14 @@ enum {MIPI_DCS_GET_SCANLINE =0x45 ,MIPI_DCS_READ_DDB_START =0xA1 ,MIPI_DCS_READ_DDB_CONTINUE =0xA8 , +MIPI_DCS_CABC_LEVEL_RD =0x52 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_RD =0x5F , + MIPI_DCS_CABC_CONTROL_RD = 0x56,Quoted 9 lines
include/video/mipi_display.h enum { · line 127
Quoted 5 lines
include/video/mipi_display.h +5
-0+MIPI_DCS_CABC_CONTROL_BRIGHT_RD =0x54 , +MIPI_DCS_CABC_LEVEL_WR =0x51 , +MIPI_DCS_CABC_MIN_BRIGHTNESS_WR =0x5E , +MIPI_DCS_CABC_CONTROL_WR =0x55 , + MIPI_DCS_CABC_CONTROL_BRIGHT_WR = 0x53,These changes need to be a separate patch. And what's the spec reference, I can't find these.
Quoted 1 line
[Deepak M] The HLD can be found in the link https://securewiki.ith.intel.com/display/GfxDisplay/MIPI+Display (it is under Intel firewall)
If you want to add stuff to include/video/mipi_display.h it has to be standard DCS commands, in actual MIPI issued specs, not something internal to us.
Manufacturer specific commands (usually referred to as MCS) need to be hidden in manufacturer specific files in the driver.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx