2018-07-05 21:49:33 +08:00
|
|
|
|
/*
|
|
|
|
|
* Copyright © 2018 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.
|
|
|
|
|
*
|
|
|
|
|
* Authors:
|
|
|
|
|
* Madhav Chauhan <madhav.chauhan@intel.com>
|
|
|
|
|
* Jani Nikula <jani.nikula@intel.com>
|
|
|
|
|
*/
|
|
|
|
|
|
2018-11-29 22:12:19 +08:00
|
|
|
|
#include <drm/drm_atomic_helper.h>
|
2019-04-05 19:00:05 +08:00
|
|
|
|
#include <drm/drm_mipi_dsi.h>
|
|
|
|
|
|
2019-04-29 20:53:31 +08:00
|
|
|
|
#include "intel_atomic.h"
|
2019-04-26 02:52:52 +08:00
|
|
|
|
#include "intel_combo_phy.h"
|
2019-04-05 19:00:06 +08:00
|
|
|
|
#include "intel_connector.h"
|
2019-04-05 19:00:05 +08:00
|
|
|
|
#include "intel_ddi.h"
|
2018-07-05 21:49:33 +08:00
|
|
|
|
#include "intel_dsi.h"
|
2019-04-05 19:00:14 +08:00
|
|
|
|
#include "intel_panel.h"
|
2019-12-10 18:51:00 +08:00
|
|
|
|
#include "intel_vdsc.h"
|
2018-07-05 21:49:33 +08:00
|
|
|
|
|
2020-04-20 22:04:38 +08:00
|
|
|
|
static int header_credits_available(struct drm_i915_private *dev_priv,
|
|
|
|
|
enum transcoder dsi_trans)
|
2018-10-30 19:56:11 +08:00
|
|
|
|
{
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
return (intel_de_read(dev_priv, DSI_CMD_TXCTL(dsi_trans)) & FREE_HEADER_CREDIT_MASK)
|
2018-10-30 19:56:11 +08:00
|
|
|
|
>> FREE_HEADER_CREDIT_SHIFT;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-20 22:04:38 +08:00
|
|
|
|
static int payload_credits_available(struct drm_i915_private *dev_priv,
|
|
|
|
|
enum transcoder dsi_trans)
|
2018-10-30 19:56:11 +08:00
|
|
|
|
{
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
return (intel_de_read(dev_priv, DSI_CMD_TXCTL(dsi_trans)) & FREE_PLOAD_CREDIT_MASK)
|
2018-10-30 19:56:11 +08:00
|
|
|
|
>> FREE_PLOAD_CREDIT_SHIFT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void wait_for_header_credits(struct drm_i915_private *dev_priv,
|
|
|
|
|
enum transcoder dsi_trans)
|
|
|
|
|
{
|
|
|
|
|
if (wait_for_us(header_credits_available(dev_priv, dsi_trans) >=
|
|
|
|
|
MAX_HEADER_CREDIT, 100))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "DSI header credits not released\n");
|
2018-10-30 19:56:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void wait_for_payload_credits(struct drm_i915_private *dev_priv,
|
|
|
|
|
enum transcoder dsi_trans)
|
|
|
|
|
{
|
|
|
|
|
if (wait_for_us(payload_credits_available(dev_priv, dsi_trans) >=
|
|
|
|
|
MAX_PLOAD_CREDIT, 100))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "DSI payload credits not released\n");
|
2018-10-30 19:56:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 22:27:59 +08:00
|
|
|
|
static enum transcoder dsi_port_to_transcoder(enum port port)
|
2018-10-15 22:27:56 +08:00
|
|
|
|
{
|
|
|
|
|
if (port == PORT_A)
|
|
|
|
|
return TRANSCODER_DSI_0;
|
|
|
|
|
else
|
|
|
|
|
return TRANSCODER_DSI_1;
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:11 +08:00
|
|
|
|
static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:11 +08:00
|
|
|
|
struct mipi_dsi_device *dsi;
|
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
/* wait for header/payload credits to be released */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
wait_for_header_credits(dev_priv, dsi_trans);
|
|
|
|
|
wait_for_payload_credits(dev_priv, dsi_trans);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* send nop DCS command */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi = intel_dsi->dsi_hosts[port]->device;
|
|
|
|
|
dsi->mode_flags |= MIPI_DSI_MODE_LPM;
|
|
|
|
|
dsi->channel = 0;
|
|
|
|
|
ret = mipi_dsi_dcs_nop(dsi);
|
|
|
|
|
if (ret < 0)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"error sending DCS NOP command\n");
|
2018-10-30 19:56:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* wait for header credits to be released */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
wait_for_header_credits(dev_priv, dsi_trans);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* wait for LP TX in progress bit to be cleared */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
if (wait_for_us(!(intel_de_read(dev_priv, DSI_LP_MSG(dsi_trans)) &
|
2018-10-30 19:56:11 +08:00
|
|
|
|
LPTX_IN_PROGRESS), 20))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "LPTX bit not cleared\n");
|
2018-10-30 19:56:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:22 +08:00
|
|
|
|
static bool add_payld_to_queue(struct intel_dsi_host *host, const u8 *data,
|
|
|
|
|
u32 len)
|
|
|
|
|
{
|
|
|
|
|
struct intel_dsi *intel_dsi = host->intel_dsi;
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
|
|
|
|
|
enum transcoder dsi_trans = dsi_port_to_transcoder(host->port);
|
|
|
|
|
int free_credits;
|
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < len; i += 4) {
|
|
|
|
|
u32 tmp = 0;
|
|
|
|
|
|
|
|
|
|
free_credits = payload_credits_available(dev_priv, dsi_trans);
|
|
|
|
|
if (free_credits < 1) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"Payload credit not available\n");
|
2018-11-29 22:12:22 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < min_t(u32, len - i, 4); j++)
|
|
|
|
|
tmp |= *data++ << 8 * j;
|
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_CMD_TXPYLD(dsi_trans), tmp);
|
2018-11-29 22:12:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int dsi_send_pkt_hdr(struct intel_dsi_host *host,
|
|
|
|
|
struct mipi_dsi_packet pkt, bool enable_lpdt)
|
|
|
|
|
{
|
|
|
|
|
struct intel_dsi *intel_dsi = host->intel_dsi;
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
|
|
|
|
|
enum transcoder dsi_trans = dsi_port_to_transcoder(host->port);
|
|
|
|
|
u32 tmp;
|
|
|
|
|
int free_credits;
|
|
|
|
|
|
|
|
|
|
/* check if header credit available */
|
|
|
|
|
free_credits = header_credits_available(dev_priv, dsi_trans);
|
|
|
|
|
if (free_credits < 1) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"send pkt header failed, not enough hdr credits\n");
|
2018-11-29 22:12:22 +08:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_CMD_TXHDR(dsi_trans));
|
2018-11-29 22:12:22 +08:00
|
|
|
|
|
|
|
|
|
if (pkt.payload)
|
|
|
|
|
tmp |= PAYLOAD_PRESENT;
|
|
|
|
|
else
|
|
|
|
|
tmp &= ~PAYLOAD_PRESENT;
|
|
|
|
|
|
|
|
|
|
tmp &= ~VBLANK_FENCE;
|
|
|
|
|
|
|
|
|
|
if (enable_lpdt)
|
|
|
|
|
tmp |= LP_DATA_TRANSFER;
|
|
|
|
|
|
|
|
|
|
tmp &= ~(PARAM_WC_MASK | VC_MASK | DT_MASK);
|
|
|
|
|
tmp |= ((pkt.header[0] & VC_MASK) << VC_SHIFT);
|
|
|
|
|
tmp |= ((pkt.header[0] & DT_MASK) << DT_SHIFT);
|
|
|
|
|
tmp |= (pkt.header[1] << PARAM_WC_LOWER_SHIFT);
|
|
|
|
|
tmp |= (pkt.header[2] << PARAM_WC_UPPER_SHIFT);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_CMD_TXHDR(dsi_trans), tmp);
|
2018-11-29 22:12:22 +08:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int dsi_send_pkt_payld(struct intel_dsi_host *host,
|
|
|
|
|
struct mipi_dsi_packet pkt)
|
|
|
|
|
{
|
drm/i915/dsi: use struct drm_device based logging
Convert all the DRM_* logging macros to the struct drm_device based
macros to provide device specific logging.
No functional changes.
Generated using the following semantic patch, originally written by
Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:
@@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com
2020-03-20 22:36:32 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = host->intel_dsi;
|
|
|
|
|
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
|
|
|
|
|
|
2018-11-29 22:12:22 +08:00
|
|
|
|
/* payload queue can accept *256 bytes*, check limit */
|
|
|
|
|
if (pkt.payload_length > MAX_PLOAD_CREDIT * 4) {
|
drm/i915/dsi: use struct drm_device based logging
Convert all the DRM_* logging macros to the struct drm_device based
macros to provide device specific logging.
No functional changes.
Generated using the following semantic patch, originally written by
Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:
@@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com
2020-03-20 22:36:32 +08:00
|
|
|
|
drm_err(&i915->drm, "payload size exceeds max queue limit\n");
|
2018-11-29 22:12:22 +08:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* load data into command payload queue */
|
|
|
|
|
if (!add_payld_to_queue(host, pkt.payload,
|
|
|
|
|
pkt.payload_length)) {
|
drm/i915/dsi: use struct drm_device based logging
Convert all the DRM_* logging macros to the struct drm_device based
macros to provide device specific logging.
No functional changes.
Generated using the following semantic patch, originally written by
Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:
@@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com
2020-03-20 22:36:32 +08:00
|
|
|
|
drm_err(&i915->drm, "adding payload to queue failed\n");
|
2018-11-29 22:12:22 +08:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-16 18:53:25 +08:00
|
|
|
|
static void dsi_program_swing_and_deemphasis(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2019-07-10 02:39:32 +08:00
|
|
|
|
enum phy phy;
|
2018-09-16 18:53:25 +08:00
|
|
|
|
u32 tmp;
|
|
|
|
|
int lane;
|
|
|
|
|
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
2018-09-16 18:53:25 +08:00
|
|
|
|
/*
|
|
|
|
|
* Program voltage swing and pre-emphasis level values as per
|
|
|
|
|
* table in BSPEC under DDI buffer programing
|
|
|
|
|
*/
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_LN0(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~(SCALING_MODE_SEL_MASK | RTERM_SELECT_MASK);
|
|
|
|
|
tmp |= SCALING_MODE_SEL(0x2);
|
|
|
|
|
tmp |= TAP2_DISABLE | TAP3_DISABLE;
|
|
|
|
|
tmp |= RTERM_SELECT(0x6);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW5_GRP(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_AUX(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~(SCALING_MODE_SEL_MASK | RTERM_SELECT_MASK);
|
|
|
|
|
tmp |= SCALING_MODE_SEL(0x2);
|
|
|
|
|
tmp |= TAP2_DISABLE | TAP3_DISABLE;
|
|
|
|
|
tmp |= RTERM_SELECT(0x6);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW5_AUX(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW2_LN0(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK |
|
|
|
|
|
RCOMP_SCALAR_MASK);
|
|
|
|
|
tmp |= SWING_SEL_UPPER(0x2);
|
|
|
|
|
tmp |= SWING_SEL_LOWER(0x2);
|
|
|
|
|
tmp |= RCOMP_SCALAR(0x98);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW2_GRP(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW2_AUX(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK |
|
|
|
|
|
RCOMP_SCALAR_MASK);
|
|
|
|
|
tmp |= SWING_SEL_UPPER(0x2);
|
|
|
|
|
tmp |= SWING_SEL_LOWER(0x2);
|
|
|
|
|
tmp |= RCOMP_SCALAR(0x98);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW2_AUX(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW4_AUX(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK |
|
|
|
|
|
CURSOR_COEFF_MASK);
|
|
|
|
|
tmp |= POST_CURSOR_1(0x0);
|
|
|
|
|
tmp |= POST_CURSOR_2(0x0);
|
|
|
|
|
tmp |= CURSOR_COEFF(0x3f);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW4_AUX(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
|
|
|
|
for (lane = 0; lane <= 3; lane++) {
|
|
|
|
|
/* Bspec: must not use GRP register for write */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
ICL_PORT_TX_DW4_LN(lane, phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK |
|
|
|
|
|
CURSOR_COEFF_MASK);
|
|
|
|
|
tmp |= POST_CURSOR_1(0x0);
|
|
|
|
|
tmp |= POST_CURSOR_2(0x0);
|
|
|
|
|
tmp |= CURSOR_COEFF(0x3f);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv,
|
|
|
|
|
ICL_PORT_TX_DW4_LN(lane, phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:26 +08:00
|
|
|
|
static void configure_dual_link_mode(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *pipe_config)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-11-29 22:12:26 +08:00
|
|
|
|
u32 dss_ctl1;
|
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
dss_ctl1 = intel_de_read(dev_priv, DSS_CTL1);
|
2018-11-29 22:12:26 +08:00
|
|
|
|
dss_ctl1 |= SPLITTER_ENABLE;
|
|
|
|
|
dss_ctl1 &= ~OVERLAP_PIXELS_MASK;
|
|
|
|
|
dss_ctl1 |= OVERLAP_PIXELS(intel_dsi->pixel_overlap);
|
|
|
|
|
|
|
|
|
|
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
|
|
|
|
|
const struct drm_display_mode *adjusted_mode =
|
2019-10-31 19:26:02 +08:00
|
|
|
|
&pipe_config->hw.adjusted_mode;
|
2018-11-29 22:12:26 +08:00
|
|
|
|
u32 dss_ctl2;
|
|
|
|
|
u16 hactive = adjusted_mode->crtc_hdisplay;
|
|
|
|
|
u16 dl_buffer_depth;
|
|
|
|
|
|
|
|
|
|
dss_ctl1 &= ~DUAL_LINK_MODE_INTERLEAVE;
|
|
|
|
|
dl_buffer_depth = hactive / 2 + intel_dsi->pixel_overlap;
|
|
|
|
|
|
|
|
|
|
if (dl_buffer_depth > MAX_DL_BUFFER_TARGET_DEPTH)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"DL buffer depth exceed max value\n");
|
2018-11-29 22:12:26 +08:00
|
|
|
|
|
|
|
|
|
dss_ctl1 &= ~LEFT_DL_BUF_TARGET_DEPTH_MASK;
|
|
|
|
|
dss_ctl1 |= LEFT_DL_BUF_TARGET_DEPTH(dl_buffer_depth);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
dss_ctl2 = intel_de_read(dev_priv, DSS_CTL2);
|
2018-11-29 22:12:26 +08:00
|
|
|
|
dss_ctl2 &= ~RIGHT_DL_BUF_TARGET_DEPTH_MASK;
|
|
|
|
|
dss_ctl2 |= RIGHT_DL_BUF_TARGET_DEPTH(dl_buffer_depth);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSS_CTL2, dss_ctl2);
|
2018-11-29 22:12:26 +08:00
|
|
|
|
} else {
|
|
|
|
|
/* Interleave */
|
|
|
|
|
dss_ctl1 |= DUAL_LINK_MODE_INTERLEAVE;
|
|
|
|
|
}
|
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSS_CTL1, dss_ctl1);
|
2018-11-29 22:12:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 18:50:54 +08:00
|
|
|
|
/* aka DSI 8X clock */
|
2019-12-10 18:50:56 +08:00
|
|
|
|
static int afe_clk(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
2019-12-10 18:50:54 +08:00
|
|
|
|
{
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2019-12-10 18:50:54 +08:00
|
|
|
|
int bpp;
|
|
|
|
|
|
2019-12-10 18:50:56 +08:00
|
|
|
|
if (crtc_state->dsc.compression_enable)
|
|
|
|
|
bpp = crtc_state->dsc.compressed_bpp;
|
|
|
|
|
else
|
|
|
|
|
bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
|
2019-12-10 18:50:54 +08:00
|
|
|
|
|
|
|
|
|
return DIV_ROUND_CLOSEST(intel_dsi->pclk * bpp, intel_dsi->lane_count);
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 18:50:56 +08:00
|
|
|
|
static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
2018-07-05 21:49:33 +08:00
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-07-05 21:49:33 +08:00
|
|
|
|
enum port port;
|
2019-12-10 18:50:54 +08:00
|
|
|
|
int afe_clk_khz;
|
2018-07-05 21:49:33 +08:00
|
|
|
|
u32 esc_clk_div_m;
|
|
|
|
|
|
2019-12-10 18:50:56 +08:00
|
|
|
|
afe_clk_khz = afe_clk(encoder, crtc_state);
|
2018-07-05 21:49:33 +08:00
|
|
|
|
esc_clk_div_m = DIV_ROUND_UP(afe_clk_khz, DSI_MAX_ESC_CLK);
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DSI_ESC_CLK_DIV(port),
|
|
|
|
|
esc_clk_div_m & ICL_ESC_CLK_DIV_MASK);
|
|
|
|
|
intel_de_posting_read(dev_priv, ICL_DSI_ESC_CLK_DIV(port));
|
2018-07-05 21:49:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DPHY_ESC_CLK_DIV(port),
|
|
|
|
|
esc_clk_div_m & ICL_ESC_CLK_DIV_MASK);
|
|
|
|
|
intel_de_posting_read(dev_priv, ICL_DPHY_ESC_CLK_DIV(port));
|
2018-07-05 21:49:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-07 20:46:55 +08:00
|
|
|
|
static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv,
|
|
|
|
|
struct intel_dsi *intel_dsi)
|
|
|
|
|
{
|
|
|
|
|
enum port port;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/display/icl_dsi: Make WARN* drm specific where drm_priv ptr is available
drm specific WARN* calls include device information in the
backtrace, so we know what device the warnings originate from.
Covert all the calls of WARN* with device specific drm_WARN*
variants in functions where drm_i915_private struct pointer is readily
available.
The conversion was done automatically with below coccinelle semantic
patch.
@rule1@
identifier func, T;
@@
func(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}
@rule2@
identifier func, T;
@@
func(struct drm_i915_private *T,...) {
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-2-pankaj.laxminarayan.bharadiya@intel.com
2020-01-29 02:15:43 +08:00
|
|
|
|
drm_WARN_ON(&dev_priv->drm, intel_dsi->io_wakeref[port]);
|
2019-04-07 20:46:55 +08:00
|
|
|
|
intel_dsi->io_wakeref[port] =
|
|
|
|
|
intel_display_power_get(dev_priv,
|
|
|
|
|
port == PORT_A ?
|
|
|
|
|
POWER_DOMAIN_PORT_DDI_A_IO :
|
|
|
|
|
POWER_DOMAIN_PORT_DDI_B_IO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-05 21:49:35 +08:00
|
|
|
|
static void gen11_dsi_enable_io_power(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-07-05 21:49:35 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
u32 tmp;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_DSI_IO_MODECTL(port));
|
2018-07-05 21:49:35 +08:00
|
|
|
|
tmp |= COMBO_PHY_MODE_DSI;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DSI_IO_MODECTL(port), tmp);
|
2018-07-05 21:49:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-07 20:46:55 +08:00
|
|
|
|
get_dsi_io_power_domains(dev_priv, intel_dsi);
|
2018-07-05 21:49:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-05 21:49:37 +08:00
|
|
|
|
static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2019-07-10 02:39:32 +08:00
|
|
|
|
enum phy phy;
|
2018-07-05 21:49:37 +08:00
|
|
|
|
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys)
|
|
|
|
|
intel_combo_phy_power_up_lanes(dev_priv, phy, true,
|
2019-04-26 02:52:52 +08:00
|
|
|
|
intel_dsi->lane_count, false);
|
2018-07-05 21:49:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-09-16 18:53:24 +08:00
|
|
|
|
static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2019-07-10 02:39:32 +08:00
|
|
|
|
enum phy phy;
|
2018-09-16 18:53:24 +08:00
|
|
|
|
u32 tmp;
|
|
|
|
|
int lane;
|
|
|
|
|
|
|
|
|
|
/* Step 4b(i) set loadgen select for transmit and aux lanes */
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW4_AUX(phy));
|
2018-09-16 18:53:24 +08:00
|
|
|
|
tmp &= ~LOADGEN_SELECT;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW4_AUX(phy), tmp);
|
2018-09-16 18:53:24 +08:00
|
|
|
|
for (lane = 0; lane <= 3; lane++) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
ICL_PORT_TX_DW4_LN(lane, phy));
|
2018-09-16 18:53:24 +08:00
|
|
|
|
tmp &= ~LOADGEN_SELECT;
|
|
|
|
|
if (lane != 2)
|
|
|
|
|
tmp |= LOADGEN_SELECT;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv,
|
|
|
|
|
ICL_PORT_TX_DW4_LN(lane, phy), tmp);
|
2018-09-16 18:53:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Step 4b(ii) set latency optimization for transmit and aux lanes */
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW2_AUX(phy));
|
2018-09-16 18:53:24 +08:00
|
|
|
|
tmp &= ~FRC_LATENCY_OPTIM_MASK;
|
|
|
|
|
tmp |= FRC_LATENCY_OPTIM_VAL(0x5);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW2_AUX(phy), tmp);
|
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW2_LN0(phy));
|
2018-09-16 18:53:24 +08:00
|
|
|
|
tmp &= ~FRC_LATENCY_OPTIM_MASK;
|
|
|
|
|
tmp |= FRC_LATENCY_OPTIM_VAL(0x5);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW2_GRP(phy), tmp);
|
2019-06-20 07:31:33 +08:00
|
|
|
|
|
2019-07-30 15:36:44 +08:00
|
|
|
|
/* For EHL, TGL, set latency optimization for PCS_DW1 lanes */
|
|
|
|
|
if (IS_ELKHARTLAKE(dev_priv) || (INTEL_GEN(dev_priv) >= 12)) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
ICL_PORT_PCS_DW1_AUX(phy));
|
2019-06-20 07:31:33 +08:00
|
|
|
|
tmp &= ~LATENCY_OPTIM_MASK;
|
|
|
|
|
tmp |= LATENCY_OPTIM_VAL(0);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_PCS_DW1_AUX(phy),
|
|
|
|
|
tmp);
|
2019-06-20 07:31:33 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
ICL_PORT_PCS_DW1_LN0(phy));
|
2019-06-20 07:31:33 +08:00
|
|
|
|
tmp &= ~LATENCY_OPTIM_MASK;
|
|
|
|
|
tmp |= LATENCY_OPTIM_VAL(0x1);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_PCS_DW1_GRP(phy),
|
|
|
|
|
tmp);
|
2019-06-20 07:31:33 +08:00
|
|
|
|
}
|
2018-09-16 18:53:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-16 18:53:25 +08:00
|
|
|
|
static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
u32 tmp;
|
2019-07-10 02:39:32 +08:00
|
|
|
|
enum phy phy;
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
|
|
|
|
/* clear common keeper enable bit */
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_PCS_DW1_LN0(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~COMMON_KEEPER_EN;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_PCS_DW1_GRP(phy), tmp);
|
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_PCS_DW1_AUX(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~COMMON_KEEPER_EN;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_PCS_DW1_AUX(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Set SUS Clock Config bitfield to 11b
|
|
|
|
|
* Note: loadgen select program is done
|
|
|
|
|
* as part of lane phy sequence configuration
|
|
|
|
|
*/
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_CL_DW5(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp |= SUS_CLOCK_CONFIG;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_CL_DW5(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Clear training enable to change swing values */
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_LN0(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~TX_TRAINING_EN;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW5_GRP(phy), tmp);
|
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_AUX(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp &= ~TX_TRAINING_EN;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW5_AUX(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Program swing and de-emphasis */
|
|
|
|
|
dsi_program_swing_and_deemphasis(encoder);
|
|
|
|
|
|
|
|
|
|
/* Set training enable to trigger update */
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_LN0(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp |= TX_TRAINING_EN;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW5_GRP(phy), tmp);
|
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_PORT_TX_DW5_AUX(phy));
|
2018-09-16 18:53:25 +08:00
|
|
|
|
tmp |= TX_TRAINING_EN;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_PORT_TX_DW5_AUX(phy), tmp);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-16 18:53:26 +08:00
|
|
|
|
static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-09-16 18:53:26 +08:00
|
|
|
|
u32 tmp;
|
|
|
|
|
enum port port;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DDI_BUF_CTL(port));
|
2018-09-16 18:53:26 +08:00
|
|
|
|
tmp |= DDI_BUF_CTL_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DDI_BUF_CTL(port), tmp);
|
2018-09-16 18:53:26 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
|
2018-09-16 18:53:26 +08:00
|
|
|
|
DDI_BUF_IS_IDLE),
|
|
|
|
|
500))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
|
|
|
|
|
port_name(port));
|
2018-09-16 18:53:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 18:50:56 +08:00
|
|
|
|
static void
|
|
|
|
|
gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
2018-09-16 18:53:27 +08:00
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-09-16 18:53:27 +08:00
|
|
|
|
u32 tmp;
|
|
|
|
|
enum port port;
|
2019-07-10 02:39:32 +08:00
|
|
|
|
enum phy phy;
|
2018-09-16 18:53:27 +08:00
|
|
|
|
|
|
|
|
|
/* Program T-INIT master registers */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_DSI_T_INIT_MASTER(port));
|
2018-09-16 18:53:27 +08:00
|
|
|
|
tmp &= ~MASTER_INIT_TIMER_MASK;
|
|
|
|
|
tmp |= intel_dsi->init_count;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DSI_T_INIT_MASTER(port), tmp);
|
2018-09-16 18:53:27 +08:00
|
|
|
|
}
|
2018-10-15 22:27:54 +08:00
|
|
|
|
|
|
|
|
|
/* Program DPHY clock lanes timings */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DPHY_CLK_TIMING_PARAM(port),
|
|
|
|
|
intel_dsi->dphy_reg);
|
2018-10-15 22:27:54 +08:00
|
|
|
|
|
|
|
|
|
/* shadow register inside display core */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_CLK_TIMING_PARAM(port),
|
|
|
|
|
intel_dsi->dphy_reg);
|
2018-10-15 22:27:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Program DPHY data lanes timings */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DPHY_DATA_TIMING_PARAM(port),
|
|
|
|
|
intel_dsi->dphy_data_lane_reg);
|
2018-10-15 22:27:54 +08:00
|
|
|
|
|
|
|
|
|
/* shadow register inside display core */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_DATA_TIMING_PARAM(port),
|
|
|
|
|
intel_dsi->dphy_data_lane_reg);
|
2018-10-15 22:27:54 +08:00
|
|
|
|
}
|
2018-10-15 22:27:55 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* If DSI link operating at or below an 800 MHz,
|
|
|
|
|
* TA_SURE should be override and programmed to
|
|
|
|
|
* a value '0' inside TA_PARAM_REGISTERS otherwise
|
|
|
|
|
* leave all fields at HW default values.
|
|
|
|
|
*/
|
2019-07-30 15:36:45 +08:00
|
|
|
|
if (IS_GEN(dev_priv, 11)) {
|
2019-12-10 18:50:56 +08:00
|
|
|
|
if (afe_clk(encoder, crtc_state) <= 800000) {
|
2019-07-30 15:36:45 +08:00
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
DPHY_TA_TIMING_PARAM(port));
|
2019-07-30 15:36:45 +08:00
|
|
|
|
tmp &= ~TA_SURE_MASK;
|
|
|
|
|
tmp |= TA_SURE_OVERRIDE | TA_SURE(0);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv,
|
|
|
|
|
DPHY_TA_TIMING_PARAM(port),
|
|
|
|
|
tmp);
|
2019-07-30 15:36:45 +08:00
|
|
|
|
|
|
|
|
|
/* shadow register inside display core */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
DSI_TA_TIMING_PARAM(port));
|
2019-07-30 15:36:45 +08:00
|
|
|
|
tmp &= ~TA_SURE_MASK;
|
|
|
|
|
tmp |= TA_SURE_OVERRIDE | TA_SURE(0);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv,
|
|
|
|
|
DSI_TA_TIMING_PARAM(port), tmp);
|
2019-07-30 15:36:45 +08:00
|
|
|
|
}
|
2018-10-15 22:27:55 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-20 07:31:34 +08:00
|
|
|
|
|
|
|
|
|
if (IS_ELKHARTLAKE(dev_priv)) {
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_DPHY_CHKN(phy));
|
2019-06-20 07:31:34 +08:00
|
|
|
|
tmp |= ICL_DPHY_CHKN_AFE_OVER_PPI_STRAP;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DPHY_CHKN(phy), tmp);
|
2019-06-20 07:31:34 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-16 18:53:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:33 +08:00
|
|
|
|
static void gen11_dsi_gate_clocks(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-11-29 22:12:33 +08:00
|
|
|
|
u32 tmp;
|
2019-07-10 02:39:31 +08:00
|
|
|
|
enum phy phy;
|
2018-11-29 22:12:33 +08:00
|
|
|
|
|
2020-02-27 04:34:45 +08:00
|
|
|
|
mutex_lock(&dev_priv->dpll.lock);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys)
|
2019-07-10 02:39:31 +08:00
|
|
|
|
tmp |= ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
|
2018-11-29 22:12:33 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, tmp);
|
2020-02-27 04:34:45 +08:00
|
|
|
|
mutex_unlock(&dev_priv->dpll.lock);
|
2018-11-29 22:12:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:34 +08:00
|
|
|
|
static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-11-29 22:12:34 +08:00
|
|
|
|
u32 tmp;
|
2019-07-10 02:39:31 +08:00
|
|
|
|
enum phy phy;
|
2018-11-29 22:12:34 +08:00
|
|
|
|
|
2020-02-27 04:34:45 +08:00
|
|
|
|
mutex_lock(&dev_priv->dpll.lock);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys)
|
2019-07-10 02:39:31 +08:00
|
|
|
|
tmp &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
|
2018-11-29 22:12:34 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, tmp);
|
2020-02-27 04:34:45 +08:00
|
|
|
|
mutex_unlock(&dev_priv->dpll.lock);
|
2018-11-29 22:12:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-03 17:43:26 +08:00
|
|
|
|
static void gen11_dsi_map_pll(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-12-03 17:43:26 +08:00
|
|
|
|
struct intel_shared_dpll *pll = crtc_state->shared_dpll;
|
2019-07-10 02:39:31 +08:00
|
|
|
|
enum phy phy;
|
2018-12-03 17:43:26 +08:00
|
|
|
|
u32 val;
|
|
|
|
|
|
2020-02-27 04:34:45 +08:00
|
|
|
|
mutex_lock(&dev_priv->dpll.lock);
|
2018-12-03 17:43:26 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
val = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
2019-07-10 02:39:31 +08:00
|
|
|
|
val &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(phy);
|
|
|
|
|
val |= ICL_DPCLKA_CFGCR0_DDI_CLK_SEL(pll->info->id, phy);
|
2018-12-03 17:43:26 +08:00
|
|
|
|
}
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, val);
|
2019-03-25 19:26:41 +08:00
|
|
|
|
|
2019-07-10 02:39:32 +08:00
|
|
|
|
for_each_dsi_phy(phy, intel_dsi->phys) {
|
2019-07-30 15:36:46 +08:00
|
|
|
|
if (INTEL_GEN(dev_priv) >= 12)
|
|
|
|
|
val |= ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
|
|
|
|
|
else
|
|
|
|
|
val &= ~ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
|
2019-03-25 19:26:41 +08:00
|
|
|
|
}
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DPCLKA_CFGCR0, val);
|
2019-03-25 19:26:41 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_posting_read(dev_priv, ICL_DPCLKA_CFGCR0);
|
2018-12-03 17:43:26 +08:00
|
|
|
|
|
2020-02-27 04:34:45 +08:00
|
|
|
|
mutex_unlock(&dev_priv->dpll.lock);
|
2018-12-03 17:43:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 22:28:01 +08:00
|
|
|
|
static void
|
|
|
|
|
gen11_dsi_configure_transcoder(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *pipe_config)
|
2018-10-15 22:27:59 +08:00
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2019-10-31 19:26:03 +08:00
|
|
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
2018-10-15 22:28:01 +08:00
|
|
|
|
enum pipe pipe = intel_crtc->pipe;
|
2018-10-15 22:27:59 +08:00
|
|
|
|
u32 tmp;
|
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans));
|
2018-10-15 22:27:59 +08:00
|
|
|
|
|
|
|
|
|
if (intel_dsi->eotp_pkt)
|
|
|
|
|
tmp &= ~EOTP_DISABLED;
|
|
|
|
|
else
|
|
|
|
|
tmp |= EOTP_DISABLED;
|
|
|
|
|
|
|
|
|
|
/* enable link calibration if freq > 1.5Gbps */
|
2019-12-10 18:50:56 +08:00
|
|
|
|
if (afe_clk(encoder, pipe_config) >= 1500 * 1000) {
|
2018-10-15 22:27:59 +08:00
|
|
|
|
tmp &= ~LINK_CALIBRATION_MASK;
|
|
|
|
|
tmp |= CALIBRATION_ENABLED_INITIAL_ONLY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* configure continuous clock */
|
|
|
|
|
tmp &= ~CONTINUOUS_CLK_MASK;
|
|
|
|
|
if (intel_dsi->clock_stop)
|
|
|
|
|
tmp |= CLK_ENTER_LP_AFTER_DATA;
|
|
|
|
|
else
|
|
|
|
|
tmp |= CLK_HS_CONTINUOUS;
|
|
|
|
|
|
|
|
|
|
/* configure buffer threshold limit to minimum */
|
|
|
|
|
tmp &= ~PIX_BUF_THRESHOLD_MASK;
|
|
|
|
|
tmp |= PIX_BUF_THRESHOLD_1_4;
|
|
|
|
|
|
|
|
|
|
/* set virtual channel to '0' */
|
|
|
|
|
tmp &= ~PIX_VIRT_CHAN_MASK;
|
|
|
|
|
tmp |= PIX_VIRT_CHAN(0);
|
|
|
|
|
|
|
|
|
|
/* program BGR transmission */
|
|
|
|
|
if (intel_dsi->bgr_enabled)
|
|
|
|
|
tmp |= BGR_TRANSMISSION;
|
|
|
|
|
|
|
|
|
|
/* select pixel format */
|
|
|
|
|
tmp &= ~PIX_FMT_MASK;
|
2019-12-10 18:50:57 +08:00
|
|
|
|
if (pipe_config->dsc.compression_enable) {
|
|
|
|
|
tmp |= PIX_FMT_COMPRESSED;
|
|
|
|
|
} else {
|
|
|
|
|
switch (intel_dsi->pixel_format) {
|
|
|
|
|
default:
|
|
|
|
|
MISSING_CASE(intel_dsi->pixel_format);
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
case MIPI_DSI_FMT_RGB565:
|
|
|
|
|
tmp |= PIX_FMT_RGB565;
|
|
|
|
|
break;
|
|
|
|
|
case MIPI_DSI_FMT_RGB666_PACKED:
|
|
|
|
|
tmp |= PIX_FMT_RGB666_PACKED;
|
|
|
|
|
break;
|
|
|
|
|
case MIPI_DSI_FMT_RGB666:
|
|
|
|
|
tmp |= PIX_FMT_RGB666_LOOSE;
|
|
|
|
|
break;
|
|
|
|
|
case MIPI_DSI_FMT_RGB888:
|
|
|
|
|
tmp |= PIX_FMT_RGB888;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-10-15 22:27:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-30 15:36:48 +08:00
|
|
|
|
if (INTEL_GEN(dev_priv) >= 12) {
|
|
|
|
|
if (is_vid_mode(intel_dsi))
|
|
|
|
|
tmp |= BLANKING_PACKET_ENABLE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 22:27:59 +08:00
|
|
|
|
/* program DSI operation mode */
|
|
|
|
|
if (is_vid_mode(intel_dsi)) {
|
|
|
|
|
tmp &= ~OP_MODE_MASK;
|
|
|
|
|
switch (intel_dsi->video_mode_format) {
|
|
|
|
|
default:
|
|
|
|
|
MISSING_CASE(intel_dsi->video_mode_format);
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
case VIDEO_MODE_NON_BURST_WITH_SYNC_EVENTS:
|
|
|
|
|
tmp |= VIDEO_MODE_SYNC_EVENT;
|
|
|
|
|
break;
|
|
|
|
|
case VIDEO_MODE_NON_BURST_WITH_SYNC_PULSE:
|
|
|
|
|
tmp |= VIDEO_MODE_SYNC_PULSE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2020-03-12 13:38:33 +08:00
|
|
|
|
} else {
|
|
|
|
|
/*
|
|
|
|
|
* FIXME: Retrieve this info from VBT.
|
|
|
|
|
* As per the spec when dsi transcoder is operating
|
|
|
|
|
* in TE GATE mode, TE comes from GPIO
|
|
|
|
|
* which is UTIL PIN for DSI 0.
|
|
|
|
|
* Also this GPIO would not be used for other
|
|
|
|
|
* purposes is an assumption.
|
|
|
|
|
*/
|
|
|
|
|
tmp &= ~OP_MODE_MASK;
|
|
|
|
|
tmp |= CMD_MODE_TE_GATE;
|
|
|
|
|
tmp |= TE_SOURCE_GPIO;
|
2018-10-15 22:27:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans), tmp);
|
2018-10-15 22:27:59 +08:00
|
|
|
|
}
|
2018-10-15 22:28:01 +08:00
|
|
|
|
|
|
|
|
|
/* enable port sync mode if dual link */
|
|
|
|
|
if (intel_dsi->dual_link) {
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
TRANS_DDI_FUNC_CTL2(dsi_trans));
|
2018-10-15 22:28:01 +08:00
|
|
|
|
tmp |= PORT_SYNC_MODE_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv,
|
|
|
|
|
TRANS_DDI_FUNC_CTL2(dsi_trans), tmp);
|
2018-10-15 22:28:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:26 +08:00
|
|
|
|
/* configure stream splitting */
|
|
|
|
|
configure_dual_link_mode(encoder, pipe_config);
|
2018-10-15 22:28:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
|
|
|
|
|
/* select data lane width */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(dsi_trans));
|
2018-10-15 22:28:01 +08:00
|
|
|
|
tmp &= ~DDI_PORT_WIDTH_MASK;
|
|
|
|
|
tmp |= DDI_PORT_WIDTH(intel_dsi->lane_count);
|
|
|
|
|
|
|
|
|
|
/* select input pipe */
|
|
|
|
|
tmp &= ~TRANS_DDI_EDP_INPUT_MASK;
|
|
|
|
|
switch (pipe) {
|
|
|
|
|
default:
|
|
|
|
|
MISSING_CASE(pipe);
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
case PIPE_A:
|
|
|
|
|
tmp |= TRANS_DDI_EDP_INPUT_A_ON;
|
|
|
|
|
break;
|
|
|
|
|
case PIPE_B:
|
|
|
|
|
tmp |= TRANS_DDI_EDP_INPUT_B_ONOFF;
|
|
|
|
|
break;
|
|
|
|
|
case PIPE_C:
|
|
|
|
|
tmp |= TRANS_DDI_EDP_INPUT_C_ONOFF;
|
|
|
|
|
break;
|
2019-11-08 05:45:58 +08:00
|
|
|
|
case PIPE_D:
|
|
|
|
|
tmp |= TRANS_DDI_EDP_INPUT_D_ONOFF;
|
|
|
|
|
break;
|
2018-10-15 22:28:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* enable DDI buffer */
|
|
|
|
|
tmp |= TRANS_DDI_FUNC_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(dsi_trans), tmp);
|
2018-10-15 22:28:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* wait for link ready */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
if (wait_for_us((intel_de_read(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans)) &
|
|
|
|
|
LINK_READY), 2500))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "DSI link not ready\n");
|
2018-10-15 22:28:01 +08:00
|
|
|
|
}
|
2018-10-15 22:27:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 22:28:03 +08:00
|
|
|
|
static void
|
|
|
|
|
gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder,
|
2019-12-10 18:50:58 +08:00
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
2018-10-15 22:28:03 +08:00
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-15 22:28:03 +08:00
|
|
|
|
const struct drm_display_mode *adjusted_mode =
|
2019-12-10 18:50:58 +08:00
|
|
|
|
&crtc_state->hw.adjusted_mode;
|
2018-10-15 22:28:03 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
/* horizontal timings */
|
|
|
|
|
u16 htotal, hactive, hsync_start, hsync_end, hsync_size;
|
2019-07-19 09:51:36 +08:00
|
|
|
|
u16 hback_porch;
|
2018-10-15 22:28:03 +08:00
|
|
|
|
/* vertical timings */
|
|
|
|
|
u16 vtotal, vactive, vsync_start, vsync_end, vsync_shift;
|
2019-12-10 18:50:58 +08:00
|
|
|
|
int mul = 1, div = 1;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Adjust horizontal timings (htotal, hsync_start, hsync_end) to account
|
|
|
|
|
* for slower link speed if DSC is enabled.
|
|
|
|
|
*
|
|
|
|
|
* The compression frequency ratio is the ratio between compressed and
|
|
|
|
|
* non-compressed link speeds, and simplifies down to the ratio between
|
|
|
|
|
* compressed and non-compressed bpp.
|
|
|
|
|
*/
|
|
|
|
|
if (crtc_state->dsc.compression_enable) {
|
|
|
|
|
mul = crtc_state->dsc.compressed_bpp;
|
|
|
|
|
div = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
|
|
|
|
|
}
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
|
|
|
|
hactive = adjusted_mode->crtc_hdisplay;
|
2020-03-12 13:38:34 +08:00
|
|
|
|
|
|
|
|
|
if (is_vid_mode(intel_dsi))
|
|
|
|
|
htotal = DIV_ROUND_UP(adjusted_mode->crtc_htotal * mul, div);
|
|
|
|
|
else
|
|
|
|
|
htotal = DIV_ROUND_UP((hactive + 160) * mul, div);
|
|
|
|
|
|
2019-12-10 18:50:58 +08:00
|
|
|
|
hsync_start = DIV_ROUND_UP(adjusted_mode->crtc_hsync_start * mul, div);
|
|
|
|
|
hsync_end = DIV_ROUND_UP(adjusted_mode->crtc_hsync_end * mul, div);
|
2018-10-15 22:28:03 +08:00
|
|
|
|
hsync_size = hsync_end - hsync_start;
|
|
|
|
|
hback_porch = (adjusted_mode->crtc_htotal -
|
|
|
|
|
adjusted_mode->crtc_hsync_end);
|
|
|
|
|
vactive = adjusted_mode->crtc_vdisplay;
|
2020-03-12 13:38:34 +08:00
|
|
|
|
|
|
|
|
|
if (is_vid_mode(intel_dsi)) {
|
|
|
|
|
vtotal = adjusted_mode->crtc_vtotal;
|
|
|
|
|
} else {
|
|
|
|
|
int bpp, line_time_us, byte_clk_period_ns;
|
|
|
|
|
|
|
|
|
|
if (crtc_state->dsc.compression_enable)
|
|
|
|
|
bpp = crtc_state->dsc.compressed_bpp;
|
|
|
|
|
else
|
|
|
|
|
bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
|
|
|
|
|
|
|
|
|
|
byte_clk_period_ns = 1000000 / afe_clk(encoder, crtc_state);
|
|
|
|
|
line_time_us = (htotal * (bpp / 8) * byte_clk_period_ns) / (1000 * intel_dsi->lane_count);
|
|
|
|
|
vtotal = vactive + DIV_ROUND_UP(400, line_time_us);
|
|
|
|
|
}
|
2018-10-15 22:28:03 +08:00
|
|
|
|
vsync_start = adjusted_mode->crtc_vsync_start;
|
|
|
|
|
vsync_end = adjusted_mode->crtc_vsync_end;
|
|
|
|
|
vsync_shift = hsync_start - htotal / 2;
|
|
|
|
|
|
|
|
|
|
if (intel_dsi->dual_link) {
|
|
|
|
|
hactive /= 2;
|
|
|
|
|
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK)
|
|
|
|
|
hactive += intel_dsi->pixel_overlap;
|
|
|
|
|
htotal /= 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* minimum hactive as per bspec: 256 pixels */
|
|
|
|
|
if (adjusted_mode->crtc_hdisplay < 256)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "hactive is less then 256 pixels\n");
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
|
|
|
|
/* if RGB666 format, then hactive must be multiple of 4 pixels */
|
|
|
|
|
if (intel_dsi->pixel_format == MIPI_DSI_FMT_RGB666 && hactive % 4 != 0)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"hactive pixels are not multiple of 4\n");
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
|
|
|
|
/* program TRANS_HTOTAL register */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, HTOTAL(dsi_trans),
|
|
|
|
|
(hactive - 1) | ((htotal - 1) << 16));
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* TRANS_HSYNC register to be programmed only for video mode */
|
2020-03-12 13:38:34 +08:00
|
|
|
|
if (is_vid_mode(intel_dsi)) {
|
2018-10-15 22:28:03 +08:00
|
|
|
|
if (intel_dsi->video_mode_format ==
|
|
|
|
|
VIDEO_MODE_NON_BURST_WITH_SYNC_PULSE) {
|
|
|
|
|
/* BSPEC: hsync size should be atleast 16 pixels */
|
|
|
|
|
if (hsync_size < 16)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"hsync size < 16 pixels\n");
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hback_porch < 16)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "hback porch < 16 pixels\n");
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
|
|
|
|
if (intel_dsi->dual_link) {
|
|
|
|
|
hsync_start /= 2;
|
|
|
|
|
hsync_end /= 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, HSYNC(dsi_trans),
|
|
|
|
|
(hsync_start - 1) | ((hsync_end - 1) << 16));
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* program TRANS_VTOTAL register */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
/*
|
|
|
|
|
* FIXME: Programing this by assuming progressive mode, since
|
|
|
|
|
* non-interlaced info from VBT is not saved inside
|
|
|
|
|
* struct drm_display_mode.
|
|
|
|
|
* For interlace mode: program required pixel minus 2
|
|
|
|
|
*/
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, VTOTAL(dsi_trans),
|
|
|
|
|
(vactive - 1) | ((vtotal - 1) << 16));
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vsync_end < vsync_start || vsync_end > vtotal)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "Invalid vsync_end value\n");
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
|
|
|
|
if (vsync_start < vactive)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "vsync_start less than vactive\n");
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
2020-03-12 13:38:34 +08:00
|
|
|
|
/* program TRANS_VSYNC register for video mode only */
|
|
|
|
|
if (is_vid_mode(intel_dsi)) {
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
intel_de_write(dev_priv, VSYNC(dsi_trans),
|
|
|
|
|
(vsync_start - 1) | ((vsync_end - 1) << 16));
|
|
|
|
|
}
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2020-03-12 13:38:34 +08:00
|
|
|
|
* FIXME: It has to be programmed only for video modes and interlaced
|
2018-10-15 22:28:03 +08:00
|
|
|
|
* modes. Put the check condition here once interlaced
|
|
|
|
|
* info available as described above.
|
|
|
|
|
* program TRANS_VSYNCSHIFT register
|
|
|
|
|
*/
|
2020-03-12 13:38:34 +08:00
|
|
|
|
if (is_vid_mode(intel_dsi)) {
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
intel_de_write(dev_priv, VSYNCSHIFT(dsi_trans),
|
|
|
|
|
vsync_shift);
|
|
|
|
|
}
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
2019-07-30 15:36:43 +08:00
|
|
|
|
|
|
|
|
|
/* program TRANS_VBLANK register, should be same as vtotal programmed */
|
|
|
|
|
if (INTEL_GEN(dev_priv) >= 12) {
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, VBLANK(dsi_trans),
|
|
|
|
|
(vactive - 1) | ((vtotal - 1) << 16));
|
2019-07-30 15:36:43 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-15 22:28:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 22:28:05 +08:00
|
|
|
|
static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-15 22:28:05 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
u32 tmp;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, PIPECONF(dsi_trans));
|
2018-10-15 22:28:05 +08:00
|
|
|
|
tmp |= PIPECONF_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, PIPECONF(dsi_trans), tmp);
|
2018-10-15 22:28:05 +08:00
|
|
|
|
|
|
|
|
|
/* wait for transcoder to be enabled */
|
2019-08-16 09:23:43 +08:00
|
|
|
|
if (intel_de_wait_for_set(dev_priv, PIPECONF(dsi_trans),
|
|
|
|
|
I965_PIPECONF_ACTIVE, 10))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"DSI transcoder not enabled\n");
|
2018-10-15 22:28:05 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 18:50:56 +08:00
|
|
|
|
static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder,
|
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
2018-10-30 19:56:22 +08:00
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:22 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
u32 tmp, hs_tx_timeout, lp_rx_timeout, ta_timeout, divisor, mul;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* escape clock count calculation:
|
|
|
|
|
* BYTE_CLK_COUNT = TIME_NS/(8 * UI)
|
|
|
|
|
* UI (nsec) = (10^6)/Bitrate
|
|
|
|
|
* TIME_NS = (BYTE_CLK_COUNT * 8 * 10^6)/ Bitrate
|
|
|
|
|
* ESCAPE_CLK_COUNT = TIME_NS/ESC_CLK_NS
|
|
|
|
|
*/
|
2019-12-10 18:50:56 +08:00
|
|
|
|
divisor = intel_dsi_tlpx_ns(intel_dsi) * afe_clk(encoder, crtc_state) * 1000;
|
2018-10-30 19:56:22 +08:00
|
|
|
|
mul = 8 * 1000000;
|
|
|
|
|
hs_tx_timeout = DIV_ROUND_UP(intel_dsi->hs_tx_timeout * mul,
|
|
|
|
|
divisor);
|
|
|
|
|
lp_rx_timeout = DIV_ROUND_UP(intel_dsi->lp_rx_timeout * mul, divisor);
|
|
|
|
|
ta_timeout = DIV_ROUND_UP(intel_dsi->turn_arnd_val * mul, divisor);
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
|
|
|
|
|
/* program hst_tx_timeout */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_HSTX_TO(dsi_trans));
|
2018-10-30 19:56:22 +08:00
|
|
|
|
tmp &= ~HSTX_TIMEOUT_VALUE_MASK;
|
|
|
|
|
tmp |= HSTX_TIMEOUT_VALUE(hs_tx_timeout);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_HSTX_TO(dsi_trans), tmp);
|
2018-10-30 19:56:22 +08:00
|
|
|
|
|
|
|
|
|
/* FIXME: DSI_CALIB_TO */
|
|
|
|
|
|
|
|
|
|
/* program lp_rx_host timeout */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_LPRX_HOST_TO(dsi_trans));
|
2018-10-30 19:56:22 +08:00
|
|
|
|
tmp &= ~LPRX_TIMEOUT_VALUE_MASK;
|
|
|
|
|
tmp |= LPRX_TIMEOUT_VALUE(lp_rx_timeout);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_LPRX_HOST_TO(dsi_trans), tmp);
|
2018-10-30 19:56:22 +08:00
|
|
|
|
|
|
|
|
|
/* FIXME: DSI_PWAIT_TO */
|
|
|
|
|
|
|
|
|
|
/* program turn around timeout */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_TA_TO(dsi_trans));
|
2018-10-30 19:56:22 +08:00
|
|
|
|
tmp &= ~TA_TIMEOUT_VALUE_MASK;
|
|
|
|
|
tmp |= TA_TIMEOUT_VALUE(ta_timeout);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_TA_TO(dsi_trans), tmp);
|
2018-10-30 19:56:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-12 13:38:33 +08:00
|
|
|
|
static void gen11_dsi_config_util_pin(struct intel_encoder *encoder,
|
|
|
|
|
bool enable)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
|
|
|
|
u32 tmp;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* used as TE i/p for DSI0,
|
|
|
|
|
* for dual link/DSI1 TE is from slave DSI1
|
|
|
|
|
* through GPIO.
|
|
|
|
|
*/
|
|
|
|
|
if (is_vid_mode(intel_dsi) || (intel_dsi->ports & BIT(PORT_B)))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
tmp = intel_de_read(dev_priv, UTIL_PIN_CTL);
|
|
|
|
|
|
|
|
|
|
if (enable) {
|
|
|
|
|
tmp |= UTIL_PIN_DIRECTION_INPUT;
|
|
|
|
|
tmp |= UTIL_PIN_ENABLE;
|
|
|
|
|
} else {
|
|
|
|
|
tmp &= ~UTIL_PIN_ENABLE;
|
|
|
|
|
}
|
|
|
|
|
intel_de_write(dev_priv, UTIL_PIN_CTL, tmp);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 22:28:01 +08:00
|
|
|
|
static void
|
|
|
|
|
gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,
|
2019-12-10 18:50:56 +08:00
|
|
|
|
const struct intel_crtc_state *crtc_state)
|
2018-07-05 21:49:37 +08:00
|
|
|
|
{
|
2019-07-30 15:36:46 +08:00
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
|
|
|
|
|
2018-07-05 21:49:37 +08:00
|
|
|
|
/* step 4a: power up all lanes of the DDI used by DSI */
|
|
|
|
|
gen11_dsi_power_up_lanes(encoder);
|
2018-09-16 18:53:24 +08:00
|
|
|
|
|
|
|
|
|
/* step 4b: configure lane sequencing of the Combo-PHY transmitters */
|
|
|
|
|
gen11_dsi_config_phy_lanes_sequence(encoder);
|
2018-09-16 18:53:25 +08:00
|
|
|
|
|
|
|
|
|
/* step 4c: configure voltage swing and skew */
|
|
|
|
|
gen11_dsi_voltage_swing_program_seq(encoder);
|
2018-09-16 18:53:26 +08:00
|
|
|
|
|
|
|
|
|
/* enable DDI buffer */
|
|
|
|
|
gen11_dsi_enable_ddi_buffer(encoder);
|
2018-09-16 18:53:27 +08:00
|
|
|
|
|
|
|
|
|
/* setup D-PHY timings */
|
2019-12-10 18:50:56 +08:00
|
|
|
|
gen11_dsi_setup_dphy_timings(encoder, crtc_state);
|
2018-10-15 22:27:59 +08:00
|
|
|
|
|
2020-03-12 13:38:33 +08:00
|
|
|
|
/* Since transcoder is configured to take events from GPIO */
|
|
|
|
|
gen11_dsi_config_util_pin(encoder, true);
|
|
|
|
|
|
2018-10-30 19:56:22 +08:00
|
|
|
|
/* step 4h: setup DSI protocol timeouts */
|
2019-12-10 18:50:56 +08:00
|
|
|
|
gen11_dsi_setup_timeouts(encoder, crtc_state);
|
2018-10-30 19:56:22 +08:00
|
|
|
|
|
2018-10-15 22:27:59 +08:00
|
|
|
|
/* Step (4h, 4i, 4j, 4k): Configure transcoder */
|
2019-12-10 18:50:56 +08:00
|
|
|
|
gen11_dsi_configure_transcoder(encoder, crtc_state);
|
2018-11-29 22:12:33 +08:00
|
|
|
|
|
|
|
|
|
/* Step 4l: Gate DDI clocks */
|
2019-07-30 15:36:46 +08:00
|
|
|
|
if (IS_GEN(dev_priv, 11))
|
|
|
|
|
gen11_dsi_gate_clocks(encoder);
|
2018-07-05 21:49:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:09 +08:00
|
|
|
|
static void gen11_dsi_powerup_panel(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:09 +08:00
|
|
|
|
struct mipi_dsi_device *dsi;
|
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
u32 tmp;
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
/* set maximum return packet size */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* FIXME: This uses the number of DW's currently in the payload
|
|
|
|
|
* receive queue. This is probably not what we want here.
|
|
|
|
|
*/
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_CMD_RXCTL(dsi_trans));
|
2018-10-30 19:56:09 +08:00
|
|
|
|
tmp &= NUMBER_RX_PLOAD_DW_MASK;
|
|
|
|
|
/* multiply "Number Rx Payload DW" by 4 to get max value */
|
|
|
|
|
tmp = tmp * 4;
|
|
|
|
|
dsi = intel_dsi->dsi_hosts[port]->device;
|
|
|
|
|
ret = mipi_dsi_set_maximum_return_packet_size(dsi, tmp);
|
|
|
|
|
if (ret < 0)
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"error setting max return pkt size%d\n", tmp);
|
2018-10-30 19:56:09 +08:00
|
|
|
|
}
|
2018-10-30 19:56:10 +08:00
|
|
|
|
|
|
|
|
|
/* panel power on related mipi dsi vbt sequences */
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON);
|
|
|
|
|
intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_INIT_OTP);
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
|
2018-10-30 19:56:11 +08:00
|
|
|
|
|
|
|
|
|
/* ensure all panel commands dispatched before enabling transcoder */
|
|
|
|
|
wait_for_cmds_dispatched_to_panel(encoder);
|
2018-10-30 19:56:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-03-14 00:48:30 +08:00
|
|
|
|
static void gen11_dsi_pre_pll_enable(struct intel_atomic_state *state,
|
|
|
|
|
struct intel_encoder *encoder,
|
2019-12-10 18:50:56 +08:00
|
|
|
|
const struct intel_crtc_state *crtc_state,
|
2018-11-29 22:12:20 +08:00
|
|
|
|
const struct drm_connector_state *conn_state)
|
2018-07-05 21:49:33 +08:00
|
|
|
|
{
|
2018-07-05 21:49:35 +08:00
|
|
|
|
/* step2: enable IO power */
|
|
|
|
|
gen11_dsi_enable_io_power(encoder);
|
|
|
|
|
|
2018-07-05 21:49:33 +08:00
|
|
|
|
/* step3: enable DSI PLL */
|
2019-12-10 18:50:56 +08:00
|
|
|
|
gen11_dsi_program_esc_clk_div(encoder, crtc_state);
|
2018-11-29 22:12:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-03-14 00:48:30 +08:00
|
|
|
|
static void gen11_dsi_pre_enable(struct intel_atomic_state *state,
|
|
|
|
|
struct intel_encoder *encoder,
|
2018-11-29 22:12:20 +08:00
|
|
|
|
const struct intel_crtc_state *pipe_config,
|
|
|
|
|
const struct drm_connector_state *conn_state)
|
|
|
|
|
{
|
2018-12-03 17:43:26 +08:00
|
|
|
|
/* step3b */
|
|
|
|
|
gen11_dsi_map_pll(encoder, pipe_config);
|
|
|
|
|
|
2018-07-05 21:49:37 +08:00
|
|
|
|
/* step4: enable DSI port and DPHY */
|
2018-10-15 22:28:01 +08:00
|
|
|
|
gen11_dsi_enable_port_and_phy(encoder, pipe_config);
|
2018-10-15 22:28:03 +08:00
|
|
|
|
|
2018-10-30 19:56:09 +08:00
|
|
|
|
/* step5: program and powerup panel */
|
|
|
|
|
gen11_dsi_powerup_panel(encoder);
|
|
|
|
|
|
2019-12-10 18:51:00 +08:00
|
|
|
|
intel_dsc_enable(encoder, pipe_config);
|
|
|
|
|
|
2018-10-15 22:28:03 +08:00
|
|
|
|
/* step6c: configure transcoder timings */
|
|
|
|
|
gen11_dsi_set_transcoder_timings(encoder, pipe_config);
|
2018-07-05 21:49:33 +08:00
|
|
|
|
}
|
2018-10-30 19:56:13 +08:00
|
|
|
|
|
2020-03-14 00:48:30 +08:00
|
|
|
|
static void gen11_dsi_enable(struct intel_atomic_state *state,
|
|
|
|
|
struct intel_encoder *encoder,
|
2020-01-29 00:28:48 +08:00
|
|
|
|
const struct intel_crtc_state *crtc_state,
|
|
|
|
|
const struct drm_connector_state *conn_state)
|
|
|
|
|
{
|
2020-01-29 00:28:49 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
|
|
|
|
|
2020-04-06 19:27:43 +08:00
|
|
|
|
drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
|
2020-01-29 00:28:48 +08:00
|
|
|
|
|
2020-01-29 00:28:49 +08:00
|
|
|
|
/* step6d: enable dsi transcoder */
|
|
|
|
|
gen11_dsi_enable_transcoder(encoder);
|
|
|
|
|
|
|
|
|
|
/* step7: enable backlight */
|
|
|
|
|
intel_panel_enable_backlight(crtc_state, conn_state);
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_ON);
|
|
|
|
|
|
2020-01-29 00:28:48 +08:00
|
|
|
|
intel_crtc_vblank_on(crtc_state);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:14 +08:00
|
|
|
|
static void gen11_dsi_disable_transcoder(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:14 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
u32 tmp;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
|
|
|
|
|
|
|
|
|
/* disable transcoder */
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, PIPECONF(dsi_trans));
|
2018-10-30 19:56:14 +08:00
|
|
|
|
tmp &= ~PIPECONF_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, PIPECONF(dsi_trans), tmp);
|
2018-10-30 19:56:14 +08:00
|
|
|
|
|
|
|
|
|
/* wait for transcoder to be disabled */
|
2019-08-16 09:23:43 +08:00
|
|
|
|
if (intel_de_wait_for_clear(dev_priv, PIPECONF(dsi_trans),
|
|
|
|
|
I965_PIPECONF_ACTIVE, 50))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"DSI trancoder not disabled\n");
|
2018-10-30 19:56:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:15 +08:00
|
|
|
|
static void gen11_dsi_powerdown_panel(struct intel_encoder *encoder)
|
|
|
|
|
{
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:15 +08:00
|
|
|
|
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_OFF);
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_ASSERT_RESET);
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_OFF);
|
|
|
|
|
|
|
|
|
|
/* ensure cmds dispatched to panel */
|
|
|
|
|
wait_for_cmds_dispatched_to_panel(encoder);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:16 +08:00
|
|
|
|
static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:16 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
u32 tmp;
|
|
|
|
|
|
2020-03-12 13:38:33 +08:00
|
|
|
|
/* disable periodic update mode */
|
|
|
|
|
if (is_cmd_mode(intel_dsi)) {
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_CMD_FRMCTL(port));
|
|
|
|
|
tmp &= ~DSI_PERIODIC_FRAME_UPDATE_ENABLE;
|
|
|
|
|
intel_de_write(dev_priv, DSI_CMD_FRMCTL(port), tmp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:16 +08:00
|
|
|
|
/* put dsi link in ULPS */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DSI_LP_MSG(dsi_trans));
|
2018-10-30 19:56:16 +08:00
|
|
|
|
tmp |= LINK_ENTER_ULPS;
|
|
|
|
|
tmp &= ~LINK_ULPS_TYPE_LP11;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DSI_LP_MSG(dsi_trans), tmp);
|
2018-10-30 19:56:16 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
if (wait_for_us((intel_de_read(dev_priv, DSI_LP_MSG(dsi_trans)) &
|
|
|
|
|
LINK_IN_ULPS),
|
2018-10-30 19:56:16 +08:00
|
|
|
|
10))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "DSI link not in ULPS\n");
|
2018-10-30 19:56:16 +08:00
|
|
|
|
}
|
2018-10-30 19:56:17 +08:00
|
|
|
|
|
|
|
|
|
/* disable ddi function */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(dsi_trans));
|
2018-10-30 19:56:17 +08:00
|
|
|
|
tmp &= ~TRANS_DDI_FUNC_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(dsi_trans), tmp);
|
2018-10-30 19:56:17 +08:00
|
|
|
|
}
|
2018-10-30 19:56:18 +08:00
|
|
|
|
|
|
|
|
|
/* disable port sync mode if dual link */
|
|
|
|
|
if (intel_dsi->dual_link) {
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv,
|
|
|
|
|
TRANS_DDI_FUNC_CTL2(dsi_trans));
|
2018-10-30 19:56:18 +08:00
|
|
|
|
tmp &= ~PORT_SYNC_MODE_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv,
|
|
|
|
|
TRANS_DDI_FUNC_CTL2(dsi_trans), tmp);
|
2018-10-30 19:56:18 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-30 19:56:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:19 +08:00
|
|
|
|
static void gen11_dsi_disable_port(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:19 +08:00
|
|
|
|
u32 tmp;
|
|
|
|
|
enum port port;
|
|
|
|
|
|
2018-11-29 22:12:34 +08:00
|
|
|
|
gen11_dsi_ungate_clocks(encoder);
|
2018-10-30 19:56:19 +08:00
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, DDI_BUF_CTL(port));
|
2018-10-30 19:56:19 +08:00
|
|
|
|
tmp &= ~DDI_BUF_CTL_ENABLE;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, DDI_BUF_CTL(port), tmp);
|
2018-10-30 19:56:19 +08:00
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
|
2018-10-30 19:56:19 +08:00
|
|
|
|
DDI_BUF_IS_IDLE),
|
|
|
|
|
8))
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm,
|
|
|
|
|
"DDI port:%c buffer not idle\n",
|
|
|
|
|
port_name(port));
|
2018-10-30 19:56:19 +08:00
|
|
|
|
}
|
2019-03-25 19:26:42 +08:00
|
|
|
|
gen11_dsi_gate_clocks(encoder);
|
2018-10-30 19:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:20 +08:00
|
|
|
|
static void gen11_dsi_disable_io_power(struct intel_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:20 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
u32 tmp;
|
|
|
|
|
|
2019-01-14 22:21:24 +08:00
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
intel_wakeref_t wakeref;
|
|
|
|
|
|
|
|
|
|
wakeref = fetch_and_zero(&intel_dsi->io_wakeref[port]);
|
2019-04-05 23:36:57 +08:00
|
|
|
|
intel_display_power_put(dev_priv,
|
|
|
|
|
port == PORT_A ?
|
|
|
|
|
POWER_DOMAIN_PORT_DDI_A_IO :
|
|
|
|
|
POWER_DOMAIN_PORT_DDI_B_IO,
|
|
|
|
|
wakeref);
|
2019-01-14 22:21:24 +08:00
|
|
|
|
}
|
2018-10-30 19:56:20 +08:00
|
|
|
|
|
|
|
|
|
/* set mode to DDI */
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, ICL_DSI_IO_MODECTL(port));
|
2018-10-30 19:56:20 +08:00
|
|
|
|
tmp &= ~COMBO_PHY_MODE_DSI;
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
intel_de_write(dev_priv, ICL_DSI_IO_MODECTL(port), tmp);
|
2018-10-30 19:56:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-14 00:48:30 +08:00
|
|
|
|
static void gen11_dsi_disable(struct intel_atomic_state *state,
|
|
|
|
|
struct intel_encoder *encoder,
|
2018-11-29 22:12:19 +08:00
|
|
|
|
const struct intel_crtc_state *old_crtc_state,
|
|
|
|
|
const struct drm_connector_state *old_conn_state)
|
2018-10-30 19:56:13 +08:00
|
|
|
|
{
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-10-30 19:56:13 +08:00
|
|
|
|
|
|
|
|
|
/* step1: turn off backlight */
|
|
|
|
|
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_OFF);
|
|
|
|
|
intel_panel_disable_backlight(old_conn_state);
|
2018-10-30 19:56:14 +08:00
|
|
|
|
|
|
|
|
|
/* step2d,e: disable transcoder and wait */
|
|
|
|
|
gen11_dsi_disable_transcoder(encoder);
|
2018-10-30 19:56:15 +08:00
|
|
|
|
|
|
|
|
|
/* step2f,g: powerdown panel */
|
|
|
|
|
gen11_dsi_powerdown_panel(encoder);
|
2018-10-30 19:56:16 +08:00
|
|
|
|
|
|
|
|
|
/* step2h,i,j: deconfig trancoder */
|
|
|
|
|
gen11_dsi_deconfigure_trancoder(encoder);
|
2018-10-30 19:56:19 +08:00
|
|
|
|
|
|
|
|
|
/* step3: disable port */
|
|
|
|
|
gen11_dsi_disable_port(encoder);
|
2018-10-30 19:56:20 +08:00
|
|
|
|
|
2020-03-12 13:38:33 +08:00
|
|
|
|
gen11_dsi_config_util_pin(encoder, false);
|
|
|
|
|
|
2018-10-30 19:56:20 +08:00
|
|
|
|
/* step4: disable IO power */
|
|
|
|
|
gen11_dsi_disable_io_power(encoder);
|
2018-10-30 19:56:13 +08:00
|
|
|
|
}
|
2018-10-30 19:56:23 +08:00
|
|
|
|
|
2020-03-14 00:48:30 +08:00
|
|
|
|
static void gen11_dsi_post_disable(struct intel_atomic_state *state,
|
|
|
|
|
struct intel_encoder *encoder,
|
2019-12-14 03:52:17 +08:00
|
|
|
|
const struct intel_crtc_state *old_crtc_state,
|
|
|
|
|
const struct drm_connector_state *old_conn_state)
|
|
|
|
|
{
|
|
|
|
|
intel_crtc_vblank_off(old_crtc_state);
|
|
|
|
|
|
|
|
|
|
intel_dsc_disable(old_crtc_state);
|
|
|
|
|
|
2019-12-24 16:40:06 +08:00
|
|
|
|
skl_scaler_disable(old_crtc_state);
|
2019-12-14 03:52:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 18:51:00 +08:00
|
|
|
|
static enum drm_mode_status gen11_dsi_mode_valid(struct drm_connector *connector,
|
|
|
|
|
struct drm_display_mode *mode)
|
|
|
|
|
{
|
|
|
|
|
/* FIXME: DSC? */
|
|
|
|
|
return intel_dsi_mode_valid(connector, mode);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-02 23:10:59 +08:00
|
|
|
|
static void gen11_dsi_get_timings(struct intel_encoder *encoder,
|
|
|
|
|
struct intel_crtc_state *pipe_config)
|
|
|
|
|
{
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2019-05-02 23:10:59 +08:00
|
|
|
|
struct drm_display_mode *adjusted_mode =
|
2019-10-31 19:26:02 +08:00
|
|
|
|
&pipe_config->hw.adjusted_mode;
|
2019-05-02 23:10:59 +08:00
|
|
|
|
|
2019-12-10 18:50:59 +08:00
|
|
|
|
if (pipe_config->dsc.compressed_bpp) {
|
|
|
|
|
int div = pipe_config->dsc.compressed_bpp;
|
|
|
|
|
int mul = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
|
|
|
|
|
|
|
|
|
|
adjusted_mode->crtc_htotal =
|
|
|
|
|
DIV_ROUND_UP(adjusted_mode->crtc_htotal * mul, div);
|
|
|
|
|
adjusted_mode->crtc_hsync_start =
|
|
|
|
|
DIV_ROUND_UP(adjusted_mode->crtc_hsync_start * mul, div);
|
|
|
|
|
adjusted_mode->crtc_hsync_end =
|
|
|
|
|
DIV_ROUND_UP(adjusted_mode->crtc_hsync_end * mul, div);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-02 23:10:59 +08:00
|
|
|
|
if (intel_dsi->dual_link) {
|
|
|
|
|
adjusted_mode->crtc_hdisplay *= 2;
|
|
|
|
|
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK)
|
|
|
|
|
adjusted_mode->crtc_hdisplay -=
|
|
|
|
|
intel_dsi->pixel_overlap;
|
|
|
|
|
adjusted_mode->crtc_htotal *= 2;
|
|
|
|
|
}
|
|
|
|
|
adjusted_mode->crtc_hblank_start = adjusted_mode->crtc_hdisplay;
|
|
|
|
|
adjusted_mode->crtc_hblank_end = adjusted_mode->crtc_htotal;
|
|
|
|
|
|
|
|
|
|
if (intel_dsi->operation_mode == INTEL_DSI_VIDEO_MODE) {
|
|
|
|
|
if (intel_dsi->dual_link) {
|
|
|
|
|
adjusted_mode->crtc_hsync_start *= 2;
|
|
|
|
|
adjusted_mode->crtc_hsync_end *= 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
adjusted_mode->crtc_vblank_start = adjusted_mode->crtc_vdisplay;
|
|
|
|
|
adjusted_mode->crtc_vblank_end = adjusted_mode->crtc_vtotal;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-12 13:38:36 +08:00
|
|
|
|
static bool gen11_dsi_is_periodic_cmd_mode(struct intel_dsi *intel_dsi)
|
|
|
|
|
{
|
|
|
|
|
struct drm_device *dev = intel_dsi->base.base.dev;
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
|
|
|
enum transcoder dsi_trans;
|
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
|
|
if (intel_dsi->ports == BIT(PORT_B))
|
|
|
|
|
dsi_trans = TRANSCODER_DSI_1;
|
|
|
|
|
else
|
|
|
|
|
dsi_trans = TRANSCODER_DSI_0;
|
|
|
|
|
|
|
|
|
|
val = intel_de_read(dev_priv, DSI_TRANS_FUNC_CONF(dsi_trans));
|
|
|
|
|
return (val & DSI_PERIODIC_FRAME_UPDATE_ENABLE);
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:23 +08:00
|
|
|
|
static void gen11_dsi_get_config(struct intel_encoder *encoder,
|
|
|
|
|
struct intel_crtc_state *pipe_config)
|
|
|
|
|
{
|
2020-02-27 04:34:53 +08:00
|
|
|
|
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
2019-10-31 19:26:03 +08:00
|
|
|
|
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-11-29 22:12:23 +08:00
|
|
|
|
|
2019-12-10 18:51:00 +08:00
|
|
|
|
intel_dsc_get_config(encoder, pipe_config);
|
|
|
|
|
|
2018-11-29 22:12:23 +08:00
|
|
|
|
/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */
|
2020-02-27 04:34:53 +08:00
|
|
|
|
pipe_config->port_clock = intel_dpll_get_freq(i915,
|
|
|
|
|
pipe_config->shared_dpll);
|
2019-05-02 23:11:02 +08:00
|
|
|
|
|
2019-10-31 19:26:02 +08:00
|
|
|
|
pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk;
|
2019-05-02 23:11:02 +08:00
|
|
|
|
if (intel_dsi->dual_link)
|
2019-10-31 19:26:02 +08:00
|
|
|
|
pipe_config->hw.adjusted_mode.crtc_clock *= 2;
|
2019-05-02 23:11:02 +08:00
|
|
|
|
|
2019-05-02 23:10:59 +08:00
|
|
|
|
gen11_dsi_get_timings(encoder, pipe_config);
|
2018-11-29 22:12:23 +08:00
|
|
|
|
pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI);
|
2019-05-02 23:11:01 +08:00
|
|
|
|
pipe_config->pipe_bpp = bdw_get_pipemisc_bpp(crtc);
|
2020-03-12 13:38:36 +08:00
|
|
|
|
|
|
|
|
|
if (gen11_dsi_is_periodic_cmd_mode(intel_dsi))
|
|
|
|
|
pipe_config->hw.adjusted_mode.private_flags |=
|
|
|
|
|
I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE;
|
2018-11-29 22:12:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-10 18:51:00 +08:00
|
|
|
|
static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
|
|
|
|
|
struct intel_crtc_state *crtc_state)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
|
|
|
|
struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
|
|
|
|
int dsc_max_bpc = INTEL_GEN(dev_priv) >= 12 ? 12 : 10;
|
|
|
|
|
bool use_dsc;
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
use_dsc = intel_bios_get_dsc_params(encoder, crtc_state, dsc_max_bpc);
|
|
|
|
|
if (!use_dsc)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (crtc_state->pipe_bpp < 8 * 3)
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
|
|
/* FIXME: split only when necessary */
|
|
|
|
|
if (crtc_state->dsc.slice_count > 1)
|
|
|
|
|
crtc_state->dsc.dsc_split = true;
|
|
|
|
|
|
|
|
|
|
vdsc_cfg->convert_rgb = true;
|
|
|
|
|
|
|
|
|
|
ret = intel_dsc_compute_params(encoder, crtc_state);
|
|
|
|
|
if (ret)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
/* DSI specific sanity checks on the common code */
|
drm/i915/display/icl_dsi: Make WARN* drm specific where drm_priv ptr is available
drm specific WARN* calls include device information in the
backtrace, so we know what device the warnings originate from.
Covert all the calls of WARN* with device specific drm_WARN*
variants in functions where drm_i915_private struct pointer is readily
available.
The conversion was done automatically with below coccinelle semantic
patch.
@rule1@
identifier func, T;
@@
func(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}
@rule2@
identifier func, T;
@@
func(struct drm_i915_private *T,...) {
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-2-pankaj.laxminarayan.bharadiya@intel.com
2020-01-29 02:15:43 +08:00
|
|
|
|
drm_WARN_ON(&dev_priv->drm, vdsc_cfg->vbr_enable);
|
|
|
|
|
drm_WARN_ON(&dev_priv->drm, vdsc_cfg->simple_422);
|
|
|
|
|
drm_WARN_ON(&dev_priv->drm,
|
|
|
|
|
vdsc_cfg->pic_width % vdsc_cfg->slice_width);
|
|
|
|
|
drm_WARN_ON(&dev_priv->drm, vdsc_cfg->slice_height < 8);
|
|
|
|
|
drm_WARN_ON(&dev_priv->drm,
|
|
|
|
|
vdsc_cfg->pic_height % vdsc_cfg->slice_height);
|
2019-12-10 18:51:00 +08:00
|
|
|
|
|
|
|
|
|
ret = drm_dsc_compute_rc_parameters(vdsc_cfg);
|
|
|
|
|
if (ret)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
crtc_state->dsc.compression_enable = true;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-16 04:08:00 +08:00
|
|
|
|
static int gen11_dsi_compute_config(struct intel_encoder *encoder,
|
|
|
|
|
struct intel_crtc_state *pipe_config,
|
|
|
|
|
struct drm_connector_state *conn_state)
|
2018-11-29 22:12:25 +08:00
|
|
|
|
{
|
drm/i915/dsi: use struct drm_device based logging
Convert all the DRM_* logging macros to the struct drm_device based
macros to provide device specific logging.
No functional changes.
Generated using the following semantic patch, originally written by
Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:
@@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com
2020-03-20 22:36:32 +08:00
|
|
|
|
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
2018-11-29 22:12:25 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
|
|
|
|
|
base);
|
|
|
|
|
struct intel_connector *intel_connector = intel_dsi->attached_connector;
|
|
|
|
|
const struct drm_display_mode *fixed_mode =
|
2020-04-23 00:19:17 +08:00
|
|
|
|
intel_connector->panel.fixed_mode;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
struct drm_display_mode *adjusted_mode =
|
2020-04-23 00:19:17 +08:00
|
|
|
|
&pipe_config->hw.adjusted_mode;
|
|
|
|
|
int ret;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
|
2019-05-02 23:11:01 +08:00
|
|
|
|
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
intel_fixed_panel_mode(fixed_mode, adjusted_mode);
|
2020-04-23 00:19:17 +08:00
|
|
|
|
|
|
|
|
|
ret = intel_pch_panel_fitting(pipe_config, conn_state);
|
|
|
|
|
if (ret)
|
|
|
|
|
return ret;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
|
|
|
|
|
adjusted_mode->flags = 0;
|
|
|
|
|
|
|
|
|
|
/* Dual link goes to trancoder DSI'0' */
|
|
|
|
|
if (intel_dsi->ports == BIT(PORT_B))
|
|
|
|
|
pipe_config->cpu_transcoder = TRANSCODER_DSI_1;
|
|
|
|
|
else
|
|
|
|
|
pipe_config->cpu_transcoder = TRANSCODER_DSI_0;
|
|
|
|
|
|
2019-12-10 18:50:53 +08:00
|
|
|
|
if (intel_dsi->pixel_format == MIPI_DSI_FMT_RGB888)
|
|
|
|
|
pipe_config->pipe_bpp = 24;
|
|
|
|
|
else
|
|
|
|
|
pipe_config->pipe_bpp = 18;
|
|
|
|
|
|
2018-11-29 22:12:25 +08:00
|
|
|
|
pipe_config->clock_set = true;
|
2019-12-10 18:51:00 +08:00
|
|
|
|
|
|
|
|
|
if (gen11_dsi_dsc_compute_config(encoder, pipe_config))
|
drm/i915/dsi: use struct drm_device based logging
Convert all the DRM_* logging macros to the struct drm_device based
macros to provide device specific logging.
No functional changes.
Generated using the following semantic patch, originally written by
Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:
@@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com
2020-03-20 22:36:32 +08:00
|
|
|
|
drm_dbg_kms(&i915->drm, "Attempting to use DSC failed\n");
|
2019-12-10 18:51:00 +08:00
|
|
|
|
|
2019-12-10 18:50:56 +08:00
|
|
|
|
pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
|
2020-03-12 13:38:36 +08:00
|
|
|
|
/* We would not operate in periodic command mode */
|
|
|
|
|
pipe_config->hw.adjusted_mode.private_flags &=
|
|
|
|
|
~I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE;
|
|
|
|
|
|
2020-03-12 13:38:37 +08:00
|
|
|
|
/*
|
|
|
|
|
* In case of TE GATE cmd mode, we
|
|
|
|
|
* receive TE from the slave if
|
|
|
|
|
* dual link is enabled
|
|
|
|
|
*/
|
|
|
|
|
if (is_cmd_mode(intel_dsi)) {
|
|
|
|
|
if (intel_dsi->ports == (BIT(PORT_B) | BIT(PORT_A)))
|
|
|
|
|
pipe_config->hw.adjusted_mode.private_flags |=
|
|
|
|
|
I915_MODE_FLAG_DSI_USE_TE1 |
|
|
|
|
|
I915_MODE_FLAG_DSI_USE_TE0;
|
|
|
|
|
else if (intel_dsi->ports == BIT(PORT_B))
|
|
|
|
|
pipe_config->hw.adjusted_mode.private_flags |=
|
|
|
|
|
I915_MODE_FLAG_DSI_USE_TE1;
|
|
|
|
|
else
|
|
|
|
|
pipe_config->hw.adjusted_mode.private_flags |=
|
|
|
|
|
I915_MODE_FLAG_DSI_USE_TE0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-16 04:08:00 +08:00
|
|
|
|
return 0;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-07 20:46:55 +08:00
|
|
|
|
static void gen11_dsi_get_power_domains(struct intel_encoder *encoder,
|
|
|
|
|
struct intel_crtc_state *crtc_state)
|
2018-11-29 22:12:24 +08:00
|
|
|
|
{
|
2019-12-10 18:51:00 +08:00
|
|
|
|
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
|
|
|
|
|
2019-12-05 02:05:43 +08:00
|
|
|
|
get_dsi_io_power_domains(i915,
|
|
|
|
|
enc_to_intel_dsi(encoder));
|
2019-12-10 18:51:00 +08:00
|
|
|
|
|
|
|
|
|
if (crtc_state->dsc.compression_enable)
|
|
|
|
|
intel_display_power_get(i915,
|
|
|
|
|
intel_dsc_power_domain(crtc_state));
|
2018-11-29 22:12:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder,
|
|
|
|
|
enum pipe *pipe)
|
|
|
|
|
{
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
2019-12-05 02:05:43 +08:00
|
|
|
|
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
2018-11-29 22:12:24 +08:00
|
|
|
|
enum transcoder dsi_trans;
|
2019-01-14 22:21:24 +08:00
|
|
|
|
intel_wakeref_t wakeref;
|
|
|
|
|
enum port port;
|
2018-11-29 22:12:24 +08:00
|
|
|
|
bool ret = false;
|
2019-01-14 22:21:24 +08:00
|
|
|
|
u32 tmp;
|
2018-11-29 22:12:24 +08:00
|
|
|
|
|
2019-01-14 22:21:24 +08:00
|
|
|
|
wakeref = intel_display_power_get_if_enabled(dev_priv,
|
|
|
|
|
encoder->power_domain);
|
|
|
|
|
if (!wakeref)
|
2018-11-29 22:12:24 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
dsi_trans = dsi_port_to_transcoder(port);
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(dsi_trans));
|
2018-11-29 22:12:24 +08:00
|
|
|
|
switch (tmp & TRANS_DDI_EDP_INPUT_MASK) {
|
|
|
|
|
case TRANS_DDI_EDP_INPUT_A_ON:
|
|
|
|
|
*pipe = PIPE_A;
|
|
|
|
|
break;
|
|
|
|
|
case TRANS_DDI_EDP_INPUT_B_ONOFF:
|
|
|
|
|
*pipe = PIPE_B;
|
|
|
|
|
break;
|
|
|
|
|
case TRANS_DDI_EDP_INPUT_C_ONOFF:
|
|
|
|
|
*pipe = PIPE_C;
|
|
|
|
|
break;
|
2019-11-08 05:45:58 +08:00
|
|
|
|
case TRANS_DDI_EDP_INPUT_D_ONOFF:
|
|
|
|
|
*pipe = PIPE_D;
|
|
|
|
|
break;
|
2018-11-29 22:12:24 +08:00
|
|
|
|
default:
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "Invalid PIPE input\n");
|
2018-11-29 22:12:24 +08:00
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
|
drm/i915/icl_dsi: use intel_de_*() functions for register access
The implicit "dev_priv" local variable use has been a long-standing pain
point in the register access macros I915_READ(), I915_WRITE(),
POSTING_READ(), I915_READ_FW(), and I915_WRITE_FW().
Replace them with the corresponding new display engine register
accessors intel_de_read(), intel_de_write(), intel_de_posting_read(),
intel_de_read_fw(), and intel_de_write_fw().
No functional changes.
Generated using the following semantic patch:
@@
expression REG, OFFSET;
@@
- I915_READ(REG)
+ intel_de_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- POSTING_READ(REG)
+ intel_de_posting_read(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE(REG, OFFSET)
+ intel_de_write(dev_priv, REG, OFFSET)
@@
expression REG;
@@
- I915_READ_FW(REG)
+ intel_de_read_fw(dev_priv, REG)
@@
expression REG, OFFSET;
@@
- I915_WRITE_FW(REG, OFFSET)
+ intel_de_write_fw(dev_priv, REG, OFFSET)
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0c3876a5beb5a33d8ab1c93e98dd16fd75339481.1580149467.git.jani.nikula@intel.com
2020-01-28 02:26:03 +08:00
|
|
|
|
tmp = intel_de_read(dev_priv, PIPECONF(dsi_trans));
|
2018-11-29 22:12:24 +08:00
|
|
|
|
ret = tmp & PIPECONF_ENABLE;
|
|
|
|
|
}
|
|
|
|
|
out:
|
2019-01-14 22:21:24 +08:00
|
|
|
|
intel_display_power_put(dev_priv, encoder->power_domain, wakeref);
|
2018-11-29 22:12:24 +08:00
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:19 +08:00
|
|
|
|
static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder)
|
|
|
|
|
{
|
|
|
|
|
intel_encoder_destroy(encoder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const struct drm_encoder_funcs gen11_dsi_encoder_funcs = {
|
|
|
|
|
.destroy = gen11_dsi_encoder_destroy,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct drm_connector_funcs gen11_dsi_connector_funcs = {
|
|
|
|
|
.late_register = intel_connector_register,
|
|
|
|
|
.early_unregister = intel_connector_unregister,
|
|
|
|
|
.destroy = intel_connector_destroy,
|
|
|
|
|
.fill_modes = drm_helper_probe_single_connector_modes,
|
|
|
|
|
.atomic_get_property = intel_digital_connector_atomic_get_property,
|
|
|
|
|
.atomic_set_property = intel_digital_connector_atomic_set_property,
|
|
|
|
|
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
|
|
|
|
|
.atomic_duplicate_state = intel_digital_connector_duplicate_state,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct drm_connector_helper_funcs gen11_dsi_connector_helper_funcs = {
|
|
|
|
|
.get_modes = intel_dsi_get_modes,
|
2019-12-10 18:51:00 +08:00
|
|
|
|
.mode_valid = gen11_dsi_mode_valid,
|
2018-11-29 22:12:19 +08:00
|
|
|
|
.atomic_check = intel_digital_connector_atomic_check,
|
|
|
|
|
};
|
|
|
|
|
|
2018-11-29 22:12:22 +08:00
|
|
|
|
static int gen11_dsi_host_attach(struct mipi_dsi_host *host,
|
|
|
|
|
struct mipi_dsi_device *dsi)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int gen11_dsi_host_detach(struct mipi_dsi_host *host,
|
|
|
|
|
struct mipi_dsi_device *dsi)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ssize_t gen11_dsi_host_transfer(struct mipi_dsi_host *host,
|
|
|
|
|
const struct mipi_dsi_msg *msg)
|
|
|
|
|
{
|
|
|
|
|
struct intel_dsi_host *intel_dsi_host = to_intel_dsi_host(host);
|
|
|
|
|
struct mipi_dsi_packet dsi_pkt;
|
|
|
|
|
ssize_t ret;
|
|
|
|
|
bool enable_lpdt = false;
|
|
|
|
|
|
|
|
|
|
ret = mipi_dsi_create_packet(&dsi_pkt, msg);
|
|
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
if (msg->flags & MIPI_DSI_MSG_USE_LPM)
|
|
|
|
|
enable_lpdt = true;
|
|
|
|
|
|
|
|
|
|
/* send packet header */
|
|
|
|
|
ret = dsi_send_pkt_hdr(intel_dsi_host, dsi_pkt, enable_lpdt);
|
|
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
/* only long packet contains payload */
|
|
|
|
|
if (mipi_dsi_packet_format_is_long(msg->type)) {
|
|
|
|
|
ret = dsi_send_pkt_payld(intel_dsi_host, dsi_pkt);
|
|
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO: add payload receive code if needed
|
|
|
|
|
|
|
|
|
|
ret = sizeof(dsi_pkt.header) + dsi_pkt.payload_length;
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const struct mipi_dsi_host_ops gen11_dsi_host_ops = {
|
|
|
|
|
.attach = gen11_dsi_host_attach,
|
|
|
|
|
.detach = gen11_dsi_host_detach,
|
|
|
|
|
.transfer = gen11_dsi_host_transfer,
|
|
|
|
|
};
|
|
|
|
|
|
2019-06-06 02:17:34 +08:00
|
|
|
|
#define ICL_PREPARE_CNT_MAX 0x7
|
|
|
|
|
#define ICL_CLK_ZERO_CNT_MAX 0xf
|
|
|
|
|
#define ICL_TRAIL_CNT_MAX 0x7
|
|
|
|
|
#define ICL_TCLK_PRE_CNT_MAX 0x3
|
|
|
|
|
#define ICL_TCLK_POST_CNT_MAX 0x7
|
|
|
|
|
#define ICL_HS_ZERO_CNT_MAX 0xf
|
|
|
|
|
#define ICL_EXIT_ZERO_CNT_MAX 0x7
|
|
|
|
|
|
|
|
|
|
static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
|
|
|
|
|
{
|
|
|
|
|
struct drm_device *dev = intel_dsi->base.base.dev;
|
|
|
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
|
|
|
struct mipi_config *mipi_config = dev_priv->vbt.dsi.config;
|
|
|
|
|
u32 tlpx_ns;
|
|
|
|
|
u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt, trail_cnt;
|
|
|
|
|
u32 ths_prepare_ns, tclk_trail_ns;
|
|
|
|
|
u32 hs_zero_cnt;
|
|
|
|
|
u32 tclk_pre_cnt, tclk_post_cnt;
|
|
|
|
|
|
|
|
|
|
tlpx_ns = intel_dsi_tlpx_ns(intel_dsi);
|
|
|
|
|
|
|
|
|
|
tclk_trail_ns = max(mipi_config->tclk_trail, mipi_config->ths_trail);
|
|
|
|
|
ths_prepare_ns = max(mipi_config->ths_prepare,
|
|
|
|
|
mipi_config->tclk_prepare);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* prepare cnt in escape clocks
|
|
|
|
|
* this field represents a hexadecimal value with a precision
|
|
|
|
|
* of 1.2 – i.e. the most significant bit is the integer
|
|
|
|
|
* and the least significant 2 bits are fraction bits.
|
|
|
|
|
* so, the field can represent a range of 0.25 to 1.75
|
|
|
|
|
*/
|
|
|
|
|
prepare_cnt = DIV_ROUND_UP(ths_prepare_ns * 4, tlpx_ns);
|
|
|
|
|
if (prepare_cnt > ICL_PREPARE_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm, "prepare_cnt out of range (%d)\n",
|
|
|
|
|
prepare_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
prepare_cnt = ICL_PREPARE_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* clk zero count in escape clocks */
|
|
|
|
|
clk_zero_cnt = DIV_ROUND_UP(mipi_config->tclk_prepare_clkzero -
|
|
|
|
|
ths_prepare_ns, tlpx_ns);
|
|
|
|
|
if (clk_zero_cnt > ICL_CLK_ZERO_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm,
|
|
|
|
|
"clk_zero_cnt out of range (%d)\n", clk_zero_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
clk_zero_cnt = ICL_CLK_ZERO_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* trail cnt in escape clocks*/
|
|
|
|
|
trail_cnt = DIV_ROUND_UP(tclk_trail_ns, tlpx_ns);
|
|
|
|
|
if (trail_cnt > ICL_TRAIL_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm, "trail_cnt out of range (%d)\n",
|
|
|
|
|
trail_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
trail_cnt = ICL_TRAIL_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* tclk pre count in escape clocks */
|
|
|
|
|
tclk_pre_cnt = DIV_ROUND_UP(mipi_config->tclk_pre, tlpx_ns);
|
|
|
|
|
if (tclk_pre_cnt > ICL_TCLK_PRE_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm,
|
|
|
|
|
"tclk_pre_cnt out of range (%d)\n", tclk_pre_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
tclk_pre_cnt = ICL_TCLK_PRE_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* tclk post count in escape clocks */
|
|
|
|
|
tclk_post_cnt = DIV_ROUND_UP(mipi_config->tclk_post, tlpx_ns);
|
|
|
|
|
if (tclk_post_cnt > ICL_TCLK_POST_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm,
|
|
|
|
|
"tclk_post_cnt out of range (%d)\n",
|
|
|
|
|
tclk_post_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
tclk_post_cnt = ICL_TCLK_POST_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* hs zero cnt in escape clocks */
|
|
|
|
|
hs_zero_cnt = DIV_ROUND_UP(mipi_config->ths_prepare_hszero -
|
|
|
|
|
ths_prepare_ns, tlpx_ns);
|
|
|
|
|
if (hs_zero_cnt > ICL_HS_ZERO_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm, "hs_zero_cnt out of range (%d)\n",
|
|
|
|
|
hs_zero_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
hs_zero_cnt = ICL_HS_ZERO_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* hs exit zero cnt in escape clocks */
|
|
|
|
|
exit_zero_cnt = DIV_ROUND_UP(mipi_config->ths_exit, tlpx_ns);
|
|
|
|
|
if (exit_zero_cnt > ICL_EXIT_ZERO_CNT_MAX) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm,
|
|
|
|
|
"exit_zero_cnt out of range (%d)\n",
|
|
|
|
|
exit_zero_cnt);
|
2019-06-06 02:17:34 +08:00
|
|
|
|
exit_zero_cnt = ICL_EXIT_ZERO_CNT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* clock lane dphy timings */
|
|
|
|
|
intel_dsi->dphy_reg = (CLK_PREPARE_OVERRIDE |
|
|
|
|
|
CLK_PREPARE(prepare_cnt) |
|
|
|
|
|
CLK_ZERO_OVERRIDE |
|
|
|
|
|
CLK_ZERO(clk_zero_cnt) |
|
|
|
|
|
CLK_PRE_OVERRIDE |
|
|
|
|
|
CLK_PRE(tclk_pre_cnt) |
|
|
|
|
|
CLK_POST_OVERRIDE |
|
|
|
|
|
CLK_POST(tclk_post_cnt) |
|
|
|
|
|
CLK_TRAIL_OVERRIDE |
|
|
|
|
|
CLK_TRAIL(trail_cnt));
|
|
|
|
|
|
|
|
|
|
/* data lanes dphy timings */
|
|
|
|
|
intel_dsi->dphy_data_lane_reg = (HS_PREPARE_OVERRIDE |
|
|
|
|
|
HS_PREPARE(prepare_cnt) |
|
|
|
|
|
HS_ZERO_OVERRIDE |
|
|
|
|
|
HS_ZERO(hs_zero_cnt) |
|
|
|
|
|
HS_TRAIL_OVERRIDE |
|
|
|
|
|
HS_TRAIL(trail_cnt) |
|
|
|
|
|
HS_EXIT_OVERRIDE |
|
|
|
|
|
HS_EXIT(exit_zero_cnt));
|
|
|
|
|
|
|
|
|
|
intel_dsi_log_params(intel_dsi);
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-27 23:24:57 +08:00
|
|
|
|
static void icl_dsi_add_properties(struct intel_connector *connector)
|
|
|
|
|
{
|
|
|
|
|
u32 allowed_scalers;
|
|
|
|
|
|
|
|
|
|
allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) |
|
|
|
|
|
BIT(DRM_MODE_SCALE_FULLSCREEN) |
|
|
|
|
|
BIT(DRM_MODE_SCALE_CENTER);
|
|
|
|
|
|
|
|
|
|
drm_connector_attach_scaling_mode_property(&connector->base,
|
|
|
|
|
allowed_scalers);
|
|
|
|
|
|
|
|
|
|
connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
|
|
|
|
|
|
2020-01-05 23:51:19 +08:00
|
|
|
|
drm_connector_set_panel_orientation_with_quirk(&connector->base,
|
|
|
|
|
intel_dsi_get_panel_orientation(connector),
|
2019-06-27 23:24:57 +08:00
|
|
|
|
connector->panel.fixed_mode->hdisplay,
|
|
|
|
|
connector->panel.fixed_mode->vdisplay);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:56:23 +08:00
|
|
|
|
void icl_dsi_init(struct drm_i915_private *dev_priv)
|
|
|
|
|
{
|
2018-11-29 22:12:19 +08:00
|
|
|
|
struct drm_device *dev = &dev_priv->drm;
|
|
|
|
|
struct intel_dsi *intel_dsi;
|
|
|
|
|
struct intel_encoder *encoder;
|
|
|
|
|
struct intel_connector *intel_connector;
|
|
|
|
|
struct drm_connector *connector;
|
2019-03-21 21:24:44 +08:00
|
|
|
|
struct drm_display_mode *fixed_mode;
|
2018-10-30 19:56:23 +08:00
|
|
|
|
enum port port;
|
|
|
|
|
|
|
|
|
|
if (!intel_bios_is_dsi_present(dev_priv, &port))
|
|
|
|
|
return;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
|
|
|
|
|
intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL);
|
|
|
|
|
if (!intel_dsi)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
intel_connector = intel_connector_alloc();
|
|
|
|
|
if (!intel_connector) {
|
|
|
|
|
kfree(intel_dsi);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
encoder = &intel_dsi->base;
|
|
|
|
|
intel_dsi->attached_connector = intel_connector;
|
|
|
|
|
connector = &intel_connector->base;
|
|
|
|
|
|
|
|
|
|
/* register DSI encoder with DRM subsystem */
|
|
|
|
|
drm_encoder_init(dev, &encoder->base, &gen11_dsi_encoder_funcs,
|
|
|
|
|
DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port));
|
|
|
|
|
|
2018-11-29 22:12:20 +08:00
|
|
|
|
encoder->pre_pll_enable = gen11_dsi_pre_pll_enable;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
encoder->pre_enable = gen11_dsi_pre_enable;
|
2020-01-29 00:28:48 +08:00
|
|
|
|
encoder->enable = gen11_dsi_enable;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
encoder->disable = gen11_dsi_disable;
|
2019-12-14 03:52:17 +08:00
|
|
|
|
encoder->post_disable = gen11_dsi_post_disable;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
encoder->port = port;
|
2018-11-29 22:12:23 +08:00
|
|
|
|
encoder->get_config = gen11_dsi_get_config;
|
2019-01-09 00:08:38 +08:00
|
|
|
|
encoder->update_pipe = intel_panel_update_backlight;
|
2018-11-29 22:12:25 +08:00
|
|
|
|
encoder->compute_config = gen11_dsi_compute_config;
|
2018-11-29 22:12:24 +08:00
|
|
|
|
encoder->get_hw_state = gen11_dsi_get_hw_state;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
encoder->type = INTEL_OUTPUT_DSI;
|
|
|
|
|
encoder->cloneable = 0;
|
2019-10-03 00:25:04 +08:00
|
|
|
|
encoder->pipe_mask = ~0;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
encoder->power_domain = POWER_DOMAIN_PORT_DSI;
|
2018-11-29 22:12:24 +08:00
|
|
|
|
encoder->get_power_domains = gen11_dsi_get_power_domains;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
|
|
|
|
|
/* register DSI connector with DRM subsystem */
|
|
|
|
|
drm_connector_init(dev, connector, &gen11_dsi_connector_funcs,
|
|
|
|
|
DRM_MODE_CONNECTOR_DSI);
|
|
|
|
|
drm_connector_helper_add(connector, &gen11_dsi_connector_helper_funcs);
|
|
|
|
|
connector->display_info.subpixel_order = SubPixelHorizontalRGB;
|
|
|
|
|
connector->interlace_allowed = false;
|
|
|
|
|
connector->doublescan_allowed = false;
|
2018-11-29 22:12:24 +08:00
|
|
|
|
intel_connector->get_hw_state = intel_connector_get_hw_state;
|
2018-11-29 22:12:19 +08:00
|
|
|
|
|
|
|
|
|
/* attach connector to encoder */
|
|
|
|
|
intel_connector_attach_encoder(intel_connector, encoder);
|
|
|
|
|
|
|
|
|
|
mutex_lock(&dev->mode_config.mutex);
|
2019-03-21 21:24:44 +08:00
|
|
|
|
fixed_mode = intel_panel_vbt_fixed_mode(intel_connector);
|
2018-11-29 22:12:19 +08:00
|
|
|
|
mutex_unlock(&dev->mode_config.mutex);
|
|
|
|
|
|
|
|
|
|
if (!fixed_mode) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_err(&dev_priv->drm, "DSI fixed mode info missing\n");
|
2018-11-29 22:12:19 +08:00
|
|
|
|
goto err;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
|
|
|
|
|
intel_panel_setup_backlight(connector, INVALID_PIPE);
|
|
|
|
|
|
2018-11-29 22:12:21 +08:00
|
|
|
|
if (dev_priv->vbt.dsi.config->dual_link)
|
|
|
|
|
intel_dsi->ports = BIT(PORT_A) | BIT(PORT_B);
|
|
|
|
|
else
|
|
|
|
|
intel_dsi->ports = BIT(port);
|
|
|
|
|
|
|
|
|
|
intel_dsi->dcs_backlight_ports = dev_priv->vbt.dsi.bl_ports;
|
|
|
|
|
intel_dsi->dcs_cabc_ports = dev_priv->vbt.dsi.cabc_ports;
|
|
|
|
|
|
2018-11-29 22:12:22 +08:00
|
|
|
|
for_each_dsi_port(port, intel_dsi->ports) {
|
|
|
|
|
struct intel_dsi_host *host;
|
|
|
|
|
|
|
|
|
|
host = intel_dsi_host_init(intel_dsi, &gen11_dsi_host_ops, port);
|
|
|
|
|
if (!host)
|
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
|
|
intel_dsi->dsi_hosts[port] = host;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 22:12:19 +08:00
|
|
|
|
if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) {
|
drm/i915/dsi: conversion to struct drm_device log macros.
This converts the more straightforward instances of the printk based
logging macros with the struct drm_device based logging macros.
This transformation was achieved using coccinelle and the following
script for matching an existing struct drm_i915_private device:
@rule1@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@rule2@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
New checkpatch warnings were fixed manually.
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122110844.2022-2-wambui.karugax@gmail.com
2020-01-22 19:08:39 +08:00
|
|
|
|
drm_dbg_kms(&dev_priv->drm, "no device found\n");
|
2018-11-29 22:12:19 +08:00
|
|
|
|
goto err;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-06 02:17:34 +08:00
|
|
|
|
icl_dphy_param_init(intel_dsi);
|
2019-06-27 23:24:57 +08:00
|
|
|
|
|
|
|
|
|
icl_dsi_add_properties(intel_connector);
|
2018-11-29 22:12:19 +08:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
err:
|
|
|
|
|
drm_encoder_cleanup(&encoder->base);
|
|
|
|
|
kfree(intel_dsi);
|
|
|
|
|
kfree(intel_connector);
|
2018-10-30 19:56:23 +08:00
|
|
|
|
}
|