mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
drm/i915/dsi: use VBT backlight and CABC port definitions directly
Drop the intermediate values stored in intel_dsi and use the VBT values directly, now that they're conveniently stored in panel->vbt. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/8b3765f1e1dc4d436b312016f72647e03ba49f94.1660664162.git.jani.nikula@intel.com
This commit is contained in:
parent
ab55165d73
commit
75217c2fcc
4 changed files with 8 additions and 17 deletions
|
@ -2074,13 +2074,9 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
|
|||
if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
|
||||
intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;
|
||||
|
||||
intel_dsi->dcs_backlight_ports = intel_connector->panel.vbt.dsi.bl_ports;
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
|
||||
intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;
|
||||
|
||||
intel_dsi->dcs_cabc_ports = intel_connector->panel.vbt.dsi.cabc_ports;
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
struct intel_dsi_host *host;
|
||||
|
||||
|
|
|
@ -89,9 +89,6 @@ struct intel_dsi {
|
|||
u8 escape_clk_div;
|
||||
u8 dual_link;
|
||||
|
||||
u16 dcs_backlight_ports;
|
||||
u16 dcs_cabc_ports;
|
||||
|
||||
/* RGB or BGR */
|
||||
bool bgr_enabled;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static u32 dcs_get_backlight(struct intel_connector *connector, enum pipe unused
|
|||
enum port port;
|
||||
size_t len = panel->backlight.max > U8_MAX ? 2 : 1;
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->dcs_backlight_ports) {
|
||||
for_each_dsi_port(port, panel->vbt.dsi.bl_ports) {
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
mipi_dsi_dcs_read(dsi_device, MIPI_DCS_GET_DISPLAY_BRIGHTNESS,
|
||||
&data, len);
|
||||
|
@ -80,7 +80,7 @@ static void dcs_set_backlight(const struct drm_connector_state *conn_state, u32
|
|||
data[1] = level;
|
||||
}
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->dcs_backlight_ports) {
|
||||
for_each_dsi_port(port, panel->vbt.dsi.bl_ports) {
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
mode_flags = dsi_device->mode_flags;
|
||||
dsi_device->mode_flags &= ~MIPI_DSI_MODE_LPM;
|
||||
|
@ -93,12 +93,13 @@ static void dcs_set_backlight(const struct drm_connector_state *conn_state, u32
|
|||
static void dcs_disable_backlight(const struct drm_connector_state *conn_state, u32 level)
|
||||
{
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(conn_state->best_encoder));
|
||||
struct intel_panel *panel = &to_intel_connector(conn_state->connector)->panel;
|
||||
struct mipi_dsi_device *dsi_device;
|
||||
enum port port;
|
||||
|
||||
dcs_set_backlight(conn_state, 0);
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->dcs_cabc_ports) {
|
||||
for_each_dsi_port(port, panel->vbt.dsi.cabc_ports) {
|
||||
u8 cabc = POWER_SAVE_OFF;
|
||||
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
|
@ -106,7 +107,7 @@ static void dcs_disable_backlight(const struct drm_connector_state *conn_state,
|
|||
&cabc, sizeof(cabc));
|
||||
}
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->dcs_backlight_ports) {
|
||||
for_each_dsi_port(port, panel->vbt.dsi.bl_ports) {
|
||||
u8 ctrl = 0;
|
||||
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
|
@ -127,10 +128,11 @@ static void dcs_enable_backlight(const struct intel_crtc_state *crtc_state,
|
|||
const struct drm_connector_state *conn_state, u32 level)
|
||||
{
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(conn_state->best_encoder));
|
||||
struct intel_panel *panel = &to_intel_connector(conn_state->connector)->panel;
|
||||
struct mipi_dsi_device *dsi_device;
|
||||
enum port port;
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->dcs_backlight_ports) {
|
||||
for_each_dsi_port(port, panel->vbt.dsi.bl_ports) {
|
||||
u8 ctrl = 0;
|
||||
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
|
@ -146,7 +148,7 @@ static void dcs_enable_backlight(const struct intel_crtc_state *crtc_state,
|
|||
&ctrl, sizeof(ctrl));
|
||||
}
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->dcs_cabc_ports) {
|
||||
for_each_dsi_port(port, panel->vbt.dsi.cabc_ports) {
|
||||
u8 cabc = POWER_SAVE_MEDIUM;
|
||||
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
|
|
|
@ -1936,13 +1936,9 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
|||
if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
|
||||
intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;
|
||||
|
||||
intel_dsi->dcs_backlight_ports = intel_connector->panel.vbt.dsi.bl_ports;
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
|
||||
intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;
|
||||
|
||||
intel_dsi->dcs_cabc_ports = intel_connector->panel.vbt.dsi.cabc_ports;
|
||||
|
||||
/* Create a DSI host (and a device) for each port. */
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
struct intel_dsi_host *host;
|
||||
|
|
Loading…
Reference in a new issue