* [PATCH v3 0/3] add color management support for the crtc
@ 2022-11-18 12:16 Kalyan Thota
2022-11-18 12:16 ` [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder Kalyan Thota
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Kalyan Thota @ 2022-11-18 12:16 UTC (permalink / raw)
To: dri-devel, linux-arm-msm, freedreno, devicetree
Cc: Kalyan Thota, linux-kernel, robdclark, dianders, swboyd,
quic_vpolimer, dmitry.baryshkov, quic_abhinavk
Add color management support for the crtc provided there are
enough dspps that can be allocated from the catalog
Kalyan Thota (3):
drm/msm/disp/dpu1: pin 1 crtc to 1 encoder
drm/msm/disp/dpu1: add helper to know if display is builtin
drm/msm/disp/dpu1: add color management support for the crtc
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 +++--
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 6 +++--
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 34 +++++++++++++++++++++++++++--
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 6 +++++
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 24 +++++++++++++-------
5 files changed, 61 insertions(+), 14 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder
2022-11-18 12:16 [PATCH v3 0/3] add color management support for the crtc Kalyan Thota
@ 2022-11-18 12:16 ` Kalyan Thota
2022-11-18 12:36 ` Dmitry Baryshkov
2022-11-18 12:16 ` [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin Kalyan Thota
2022-11-18 12:16 ` [PATCH v3 3/3] drm/msm/disp/dpu1: add color management support for the crtc Kalyan Thota
2 siblings, 1 reply; 9+ messages in thread
From: Kalyan Thota @ 2022-11-18 12:16 UTC (permalink / raw)
To: dri-devel, linux-arm-msm, freedreno, devicetree
Cc: Kalyan Thota, linux-kernel, robdclark, dianders, swboyd,
quic_vpolimer, dmitry.baryshkov, quic_abhinavk
Pin each crtc with one encoder. This arrangement will
disallow crtc switching between encoders and also will
facilitate to advertise certain features on crtc based
on encoder type.
Changes in v1:
- use drm_for_each_encoder macro while iterating through
encoder list (Dmitry)
Changes in v2:
- make sure no encoder miss to have a crtc (Dmitry)
- revisit various factors in deciding the crtc count
such as num_mixers, num_sspp (Dmitry)
Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 7a5fabc..4784db8 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -763,7 +763,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
drm_for_each_encoder(encoder, dev)
num_encoders++;
- max_crtc_count = min(catalog->mixer_count, num_encoders);
+ max_crtc_count = num_encoders;
/* Create the planes, keeping track of one primary/cursor per crtc */
for (i = 0; i < catalog->sspp_count; i++) {
@@ -795,22 +795,25 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
primary_planes[primary_planes_idx++] = plane;
}
- max_crtc_count = min(max_crtc_count, primary_planes_idx);
+ /*
+ * All the platforms should have at least 1 primary plane for an
+ * encoder. The below warn should help in setting up the catalog
+ */
+ WARN_ON(num_encoders > primary_planes_idx);
/* Create one CRTC per encoder */
- for (i = 0; i < max_crtc_count; i++) {
+ i = 0;
+ drm_for_each_encoder(encoder, dev) {
crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
if (IS_ERR(crtc)) {
ret = PTR_ERR(crtc);
return ret;
}
priv->crtcs[priv->num_crtcs++] = crtc;
+ encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
+ i++;
}
- /* All CRTCs are compatible with all encoders */
- drm_for_each_encoder(encoder, dev)
- encoder->possible_crtcs = (1 << priv->num_crtcs) - 1;
-
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin
2022-11-18 12:16 [PATCH v3 0/3] add color management support for the crtc Kalyan Thota
2022-11-18 12:16 ` [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder Kalyan Thota
@ 2022-11-18 12:16 ` Kalyan Thota
2022-11-18 12:38 ` Dmitry Baryshkov
2022-11-18 12:16 ` [PATCH v3 3/3] drm/msm/disp/dpu1: add color management support for the crtc Kalyan Thota
2 siblings, 1 reply; 9+ messages in thread
From: Kalyan Thota @ 2022-11-18 12:16 UTC (permalink / raw)
To: dri-devel, linux-arm-msm, freedreno, devicetree
Cc: Kalyan Thota, linux-kernel, robdclark, dianders, swboyd,
quic_vpolimer, dmitry.baryshkov, quic_abhinavk
Since DRM encoder type for few encoders can be similar
(like eDP and DP) find out if the interface supports HPD
from encoder bridge to differentiate between builtin
and pluggable displays.
Changes in v1:
- add connector type in the disp_info (Dmitry)
- add helper functions to know encoder type
- update commit text reflecting the change
Changes in v2:
- avoid hardcode of connector type for DSI as it may not be true (Dmitry)
- get the HPD information from encoder bridge
Changes in v3:
- use bridge type instead of bridge ops in determining connector (Dmitry)
Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27 +++++++++++++++++++++++++++
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 6 ++++++
2 files changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 9c6817b..574f2b0 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -15,6 +15,7 @@
#include <drm/drm_crtc.h>
#include <drm/drm_file.h>
#include <drm/drm_probe_helper.h>
+#include <drm/drm_bridge.h>
#include "msm_drv.h"
#include "dpu_kms.h"
@@ -217,6 +218,32 @@ static u32 dither_matrix[DITHER_MATRIX_SZ] = {
15, 7, 13, 5, 3, 11, 1, 9, 12, 4, 14, 6, 0, 8, 2, 10
};
+bool dpu_encoder_is_builtin(struct drm_encoder *encoder)
+{
+ struct drm_bridge *bridge;
+ int ops = 0;
+
+ if (!encoder)
+ return false;
+
+ /* Get last bridge in the chain to determine connector type */
+ drm_for_each_bridge_in_chain(encoder, bridge)
+ if (!drm_bridge_get_next_bridge(bridge))
+ ops = bridge->type;
+
+ switch (ops) {
+ case DRM_MODE_CONNECTOR_Unknown:
+ case DRM_MODE_CONNECTOR_LVDS:
+ case DRM_MODE_CONNECTOR_eDP:
+ case DRM_MODE_CONNECTOR_DSI:
+ case DRM_MODE_CONNECTOR_DPI:
+ case DRM_MODE_CONNECTOR_WRITEBACK:
+ case DRM_MODE_CONNECTOR_VIRTUAL:
+ return true;
+ default:
+ return false;
+ }
+}
bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)
{
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
index 9e7236e..7f3d823 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
@@ -224,4 +224,10 @@ void dpu_encoder_cleanup_wb_job(struct drm_encoder *drm_enc,
*/
bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc);
+/**
+ * dpu_encoder_is_builtin - find if the encoder is of type builtin
+ * @drm_enc: Pointer to previously created drm encoder structure
+ */
+bool dpu_encoder_is_builtin(struct drm_encoder *drm_enc);
+
#endif /* __DPU_ENCODER_H__ */
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 3/3] drm/msm/disp/dpu1: add color management support for the crtc
2022-11-18 12:16 [PATCH v3 0/3] add color management support for the crtc Kalyan Thota
2022-11-18 12:16 ` [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder Kalyan Thota
2022-11-18 12:16 ` [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin Kalyan Thota
@ 2022-11-18 12:16 ` Kalyan Thota
2022-11-18 12:40 ` Dmitry Baryshkov
2 siblings, 1 reply; 9+ messages in thread
From: Kalyan Thota @ 2022-11-18 12:16 UTC (permalink / raw)
To: dri-devel, linux-arm-msm, freedreno, devicetree
Cc: Kalyan Thota, linux-kernel, robdclark, dianders, swboyd,
quic_vpolimer, dmitry.baryshkov, quic_abhinavk
Add color management support for the crtc provided there are
enough dspps that can be allocated from the catalog.
Changes in v1:
- cache color enabled state in the dpu crtc obj (Dmitry)
- simplify dspp allocation while creating crtc (Dmitry)
- register for color when crtc is created (Dmitry)
Changes in v2:
- avoid primary encoders in the documentation (Dmitry)
Changes in v3:
- add ctm for builtin encoders (Dmitry)
Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 +++--
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 6 ++++--
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 7 +++++--
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 7 ++++++-
4 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 4170fbe..6cacaaf 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1571,7 +1571,7 @@ static const struct drm_crtc_helper_funcs dpu_crtc_helper_funcs = {
/* initialize crtc */
struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
- struct drm_plane *cursor)
+ struct drm_plane *cursor, bool ctm)
{
struct drm_crtc *crtc = NULL;
struct dpu_crtc *dpu_crtc = NULL;
@@ -1583,6 +1583,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
crtc = &dpu_crtc->base;
crtc->dev = dev;
+ dpu_crtc->color_enabled = ctm;
spin_lock_init(&dpu_crtc->spin_lock);
atomic_set(&dpu_crtc->frame_pending, 0);
@@ -1604,7 +1605,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
- drm_crtc_enable_color_mgmt(crtc, 0, true, 0);
+ drm_crtc_enable_color_mgmt(crtc, 0, dpu_crtc->color_enabled, 0);
/* save user friendly CRTC name for later */
snprintf(dpu_crtc->name, DPU_CRTC_NAME_SIZE, "crtc%u", crtc->base.id);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index 539b68b..1ec9517 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -136,6 +136,7 @@ struct dpu_crtc_frame_event {
* @enabled : whether the DPU CRTC is currently enabled. updated in the
* commit-thread, not state-swap time which is earlier, so
* safe to make decisions on during VBLANK on/off work
+ * @color_enabled : whether crtc supports color management
* @feature_list : list of color processing features supported on a crtc
* @active_list : list of color processing features are active
* @dirty_list : list of color processing features are dirty
@@ -164,7 +165,7 @@ struct dpu_crtc {
u64 play_count;
ktime_t vblank_cb_time;
bool enabled;
-
+ bool color_enabled;
struct list_head feature_list;
struct list_head active_list;
struct list_head dirty_list;
@@ -269,10 +270,11 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc);
* @dev: dpu device
* @plane: base plane
* @cursor: cursor plane
+ * @ctm: ctm flag
* @Return: new crtc object or error
*/
struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
- struct drm_plane *cursor);
+ struct drm_plane *cursor, bool ctm);
/**
* dpu_crtc_register_custom_event - api for enabling/disabling crtc event
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 574f2b0..102612c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -572,6 +572,7 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
static struct msm_display_topology dpu_encoder_get_topology(
struct dpu_encoder_virt *dpu_enc,
struct dpu_kms *dpu_kms,
+ struct dpu_crtc *dpu_crtc,
struct drm_display_mode *mode)
{
struct msm_display_topology topology = {0};
@@ -600,7 +601,7 @@ static struct msm_display_topology dpu_encoder_get_topology(
else
topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
- if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
+ if (dpu_crtc->color_enabled) {
if (dpu_kms->catalog->dspp &&
(dpu_kms->catalog->dspp_count >= topology.num_lm))
topology.num_dspp = topology.num_lm;
@@ -635,6 +636,7 @@ static int dpu_encoder_virt_atomic_check(
struct drm_display_mode *adj_mode;
struct msm_display_topology topology;
struct dpu_global_state *global_state;
+ struct dpu_crtc *dpu_crtc;
int i = 0;
int ret = 0;
@@ -645,6 +647,7 @@ static int dpu_encoder_virt_atomic_check(
}
dpu_enc = to_dpu_encoder_virt(drm_enc);
+ dpu_crtc = to_dpu_crtc(crtc_state->crtc);
DPU_DEBUG_ENC(dpu_enc, "\n");
priv = drm_enc->dev->dev_private;
@@ -670,7 +673,7 @@ static int dpu_encoder_virt_atomic_check(
}
}
- topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode);
+ topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, dpu_crtc, adj_mode);
/* Reserve dynamic resources now. */
if (!ret) {
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 4784db8..b57e261 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -747,6 +747,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
int primary_planes_idx = 0, cursor_planes_idx = 0, i, ret;
int max_crtc_count;
+
dev = dpu_kms->dev;
priv = dev->dev_private;
catalog = dpu_kms->catalog;
@@ -804,7 +805,11 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
/* Create one CRTC per encoder */
i = 0;
drm_for_each_encoder(encoder, dev) {
- crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
+ bool _ctm = false;
+ if (catalog->dspp_count && dpu_encoder_is_builtin(encoder) &&
+ encoder->encoder_type != DRM_MODE_ENCODER_VIRTUAL)
+ _ctm = true;
+ crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i], _ctm);
if (IS_ERR(crtc)) {
ret = PTR_ERR(crtc);
return ret;
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder
2022-11-18 12:16 ` [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder Kalyan Thota
@ 2022-11-18 12:36 ` Dmitry Baryshkov
0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2022-11-18 12:36 UTC (permalink / raw)
To: Kalyan Thota, dri-devel, linux-arm-msm, freedreno, devicetree
Cc: linux-kernel, robdclark, dianders, swboyd, quic_vpolimer,
quic_abhinavk
On 18/11/2022 15:16, Kalyan Thota wrote:
> Pin each crtc with one encoder. This arrangement will
> disallow crtc switching between encoders and also will
> facilitate to advertise certain features on crtc based
> on encoder type.
>
> Changes in v1:
> - use drm_for_each_encoder macro while iterating through
> encoder list (Dmitry)
>
> Changes in v2:
> - make sure no encoder miss to have a crtc (Dmitry)
> - revisit various factors in deciding the crtc count
> such as num_mixers, num_sspp (Dmitry)
>
> Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 7a5fabc..4784db8 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -763,7 +763,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
> drm_for_each_encoder(encoder, dev)
> num_encoders++;
>
> - max_crtc_count = min(catalog->mixer_count, num_encoders);
> + max_crtc_count = num_encoders;
>
> /* Create the planes, keeping track of one primary/cursor per crtc */
> for (i = 0; i < catalog->sspp_count; i++) {
> @@ -795,22 +795,25 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
> primary_planes[primary_planes_idx++] = plane;
> }
>
> - max_crtc_count = min(max_crtc_count, primary_planes_idx);
> + /*
> + * All the platforms should have at least 1 primary plane for an
> + * encoder. The below warn should help in setting up the catalog
> + */
> + WARN_ON(num_encoders > primary_planes_idx);
WARN_ON(max_crtc_count > primary_planes_idx)
We do not care about encoders number, we care about CRTCs number here.
With that fixed:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> /* Create one CRTC per encoder */
> - for (i = 0; i < max_crtc_count; i++) {
> + i = 0;
> + drm_for_each_encoder(encoder, dev) {
> crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
> if (IS_ERR(crtc)) {
> ret = PTR_ERR(crtc);
> return ret;
> }
> priv->crtcs[priv->num_crtcs++] = crtc;
> + encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
> + i++;
> }
>
> - /* All CRTCs are compatible with all encoders */
> - drm_for_each_encoder(encoder, dev)
> - encoder->possible_crtcs = (1 << priv->num_crtcs) - 1;
> -
> return 0;
> }
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin
2022-11-18 12:16 ` [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin Kalyan Thota
@ 2022-11-18 12:38 ` Dmitry Baryshkov
2022-11-18 14:37 ` Kalyan Thota
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2022-11-18 12:38 UTC (permalink / raw)
To: Kalyan Thota, dri-devel, linux-arm-msm, freedreno, devicetree
Cc: linux-kernel, robdclark, dianders, swboyd, quic_vpolimer,
quic_abhinavk
On 18/11/2022 15:16, Kalyan Thota wrote:
> Since DRM encoder type for few encoders can be similar
> (like eDP and DP) find out if the interface supports HPD
> from encoder bridge to differentiate between builtin
> and pluggable displays.
>
> Changes in v1:
> - add connector type in the disp_info (Dmitry)
> - add helper functions to know encoder type
> - update commit text reflecting the change
>
> Changes in v2:
> - avoid hardcode of connector type for DSI as it may not be true (Dmitry)
> - get the HPD information from encoder bridge
>
> Changes in v3:
> - use bridge type instead of bridge ops in determining connector (Dmitry)
>
> Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27 +++++++++++++++++++++++++++
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 6 ++++++
> 2 files changed, 33 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 9c6817b..574f2b0 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -15,6 +15,7 @@
> #include <drm/drm_crtc.h>
> #include <drm/drm_file.h>
> #include <drm/drm_probe_helper.h>
> +#include <drm/drm_bridge.h>
>
> #include "msm_drv.h"
> #include "dpu_kms.h"
> @@ -217,6 +218,32 @@ static u32 dither_matrix[DITHER_MATRIX_SZ] = {
> 15, 7, 13, 5, 3, 11, 1, 9, 12, 4, 14, 6, 0, 8, 2, 10
> };
>
> +bool dpu_encoder_is_builtin(struct drm_encoder *encoder)
> +{
> + struct drm_bridge *bridge;
> + int ops = 0;
> +
> + if (!encoder)
> + return false;
> +
> + /* Get last bridge in the chain to determine connector type */
> + drm_for_each_bridge_in_chain(encoder, bridge)
> + if (!drm_bridge_get_next_bridge(bridge))
> + ops = bridge->type;
Why don't we check the connector type directly? You should not assume
that connector's type is equal to the latest bridge's type.
> +
> + switch (ops) {
> + case DRM_MODE_CONNECTOR_Unknown:
> + case DRM_MODE_CONNECTOR_LVDS:
> + case DRM_MODE_CONNECTOR_eDP:
> + case DRM_MODE_CONNECTOR_DSI:
> + case DRM_MODE_CONNECTOR_DPI:
> + case DRM_MODE_CONNECTOR_WRITEBACK:
> + case DRM_MODE_CONNECTOR_VIRTUAL:
Unknown, WRITEBACK and VIRTUAL are not builtin (for the point of CTM at
least).
> + return true;
> + default:
> + return false;
> + }
> +}
>
> bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)
> {
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
> index 9e7236e..7f3d823 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
> @@ -224,4 +224,10 @@ void dpu_encoder_cleanup_wb_job(struct drm_encoder *drm_enc,
> */
> bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc);
>
> +/**
> + * dpu_encoder_is_builtin - find if the encoder is of type builtin
> + * @drm_enc: Pointer to previously created drm encoder structure
> + */
> +bool dpu_encoder_is_builtin(struct drm_encoder *drm_enc);
> +
> #endif /* __DPU_ENCODER_H__ */
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 3/3] drm/msm/disp/dpu1: add color management support for the crtc
2022-11-18 12:16 ` [PATCH v3 3/3] drm/msm/disp/dpu1: add color management support for the crtc Kalyan Thota
@ 2022-11-18 12:40 ` Dmitry Baryshkov
0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2022-11-18 12:40 UTC (permalink / raw)
To: Kalyan Thota, dri-devel, linux-arm-msm, freedreno, devicetree
Cc: linux-kernel, robdclark, dianders, swboyd, quic_vpolimer,
quic_abhinavk
On 18/11/2022 15:16, Kalyan Thota wrote:
> Add color management support for the crtc provided there are
> enough dspps that can be allocated from the catalog.
>
> Changes in v1:
> - cache color enabled state in the dpu crtc obj (Dmitry)
> - simplify dspp allocation while creating crtc (Dmitry)
> - register for color when crtc is created (Dmitry)
>
> Changes in v2:
> - avoid primary encoders in the documentation (Dmitry)
>
> Changes in v3:
> - add ctm for builtin encoders (Dmitry)
>
> Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
With two minor nits (stated below) fixed:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 +++--
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 6 ++++--
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 7 +++++--
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 7 ++++++-
> 4 files changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 4170fbe..6cacaaf 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -1571,7 +1571,7 @@ static const struct drm_crtc_helper_funcs dpu_crtc_helper_funcs = {
>
> /* initialize crtc */
> struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
> - struct drm_plane *cursor)
> + struct drm_plane *cursor, bool ctm)
> {
> struct drm_crtc *crtc = NULL;
> struct dpu_crtc *dpu_crtc = NULL;
> @@ -1583,6 +1583,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
>
> crtc = &dpu_crtc->base;
> crtc->dev = dev;
> + dpu_crtc->color_enabled = ctm;
>
> spin_lock_init(&dpu_crtc->spin_lock);
> atomic_set(&dpu_crtc->frame_pending, 0);
> @@ -1604,7 +1605,7 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
>
> drm_crtc_helper_add(crtc, &dpu_crtc_helper_funcs);
>
> - drm_crtc_enable_color_mgmt(crtc, 0, true, 0);
> + drm_crtc_enable_color_mgmt(crtc, 0, dpu_crtc->color_enabled, 0);
>
> /* save user friendly CRTC name for later */
> snprintf(dpu_crtc->name, DPU_CRTC_NAME_SIZE, "crtc%u", crtc->base.id);
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
> index 539b68b..1ec9517 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
> @@ -136,6 +136,7 @@ struct dpu_crtc_frame_event {
> * @enabled : whether the DPU CRTC is currently enabled. updated in the
> * commit-thread, not state-swap time which is earlier, so
> * safe to make decisions on during VBLANK on/off work
> + * @color_enabled : whether crtc supports color management
> * @feature_list : list of color processing features supported on a crtc
> * @active_list : list of color processing features are active
> * @dirty_list : list of color processing features are dirty
> @@ -164,7 +165,7 @@ struct dpu_crtc {
> u64 play_count;
> ktime_t vblank_cb_time;
> bool enabled;
> -
> + bool color_enabled;
Keep the empty line after color_enabled please.
> struct list_head feature_list;
> struct list_head active_list;
> struct list_head dirty_list;
> @@ -269,10 +270,11 @@ void dpu_crtc_complete_commit(struct drm_crtc *crtc);
> * @dev: dpu device
> * @plane: base plane
> * @cursor: cursor plane
> + * @ctm: ctm flag
> * @Return: new crtc object or error
> */
> struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,
> - struct drm_plane *cursor);
> + struct drm_plane *cursor, bool ctm);
>
> /**
> * dpu_crtc_register_custom_event - api for enabling/disabling crtc event
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 574f2b0..102612c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -572,6 +572,7 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
> static struct msm_display_topology dpu_encoder_get_topology(
> struct dpu_encoder_virt *dpu_enc,
> struct dpu_kms *dpu_kms,
> + struct dpu_crtc *dpu_crtc,
> struct drm_display_mode *mode)
> {
> struct msm_display_topology topology = {0};
> @@ -600,7 +601,7 @@ static struct msm_display_topology dpu_encoder_get_topology(
> else
> topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
>
> - if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
> + if (dpu_crtc->color_enabled) {
> if (dpu_kms->catalog->dspp &&
> (dpu_kms->catalog->dspp_count >= topology.num_lm))
> topology.num_dspp = topology.num_lm;
> @@ -635,6 +636,7 @@ static int dpu_encoder_virt_atomic_check(
> struct drm_display_mode *adj_mode;
> struct msm_display_topology topology;
> struct dpu_global_state *global_state;
> + struct dpu_crtc *dpu_crtc;
> int i = 0;
> int ret = 0;
>
> @@ -645,6 +647,7 @@ static int dpu_encoder_virt_atomic_check(
> }
>
> dpu_enc = to_dpu_encoder_virt(drm_enc);
> + dpu_crtc = to_dpu_crtc(crtc_state->crtc);
> DPU_DEBUG_ENC(dpu_enc, "\n");
>
> priv = drm_enc->dev->dev_private;
> @@ -670,7 +673,7 @@ static int dpu_encoder_virt_atomic_check(
> }
> }
>
> - topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode);
> + topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, dpu_crtc, adj_mode);
>
> /* Reserve dynamic resources now. */
> if (!ret) {
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 4784db8..b57e261 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -747,6 +747,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
>
> int primary_planes_idx = 0, cursor_planes_idx = 0, i, ret;
> int max_crtc_count;
> +
> dev = dpu_kms->dev;
> priv = dev->dev_private;
> catalog = dpu_kms->catalog;
> @@ -804,7 +805,11 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
> /* Create one CRTC per encoder */
> i = 0;
> drm_for_each_encoder(encoder, dev) {
> - crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
> + bool _ctm = false;
> + if (catalog->dspp_count && dpu_encoder_is_builtin(encoder) &&
> + encoder->encoder_type != DRM_MODE_ENCODER_VIRTUAL)
The last condition should be handled in the dpu_encoder_is_bultin()
> + _ctm = true;
> + crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i], _ctm);
> if (IS_ERR(crtc)) {
> ret = PTR_ERR(crtc);
> return ret;
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin
2022-11-18 12:38 ` Dmitry Baryshkov
@ 2022-11-18 14:37 ` Kalyan Thota
2022-11-18 15:00 ` Dmitry Baryshkov
0 siblings, 1 reply; 9+ messages in thread
From: Kalyan Thota @ 2022-11-18 14:37 UTC (permalink / raw)
To: dmitry.baryshkov@linaro.org, Kalyan Thota (QUIC),
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org, devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, robdclark@chromium.org,
dianders@chromium.org, swboyd@chromium.org, Vinod Polimera (QUIC),
Abhinav Kumar (QUIC)
>-----Original Message-----
>From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>Sent: Friday, November 18, 2022 6:09 PM
>To: Kalyan Thota (QUIC) <quic_kalyant@quicinc.com>; dri-
>devel@lists.freedesktop.org; linux-arm-msm@vger.kernel.org;
>freedreno@lists.freedesktop.org; devicetree@vger.kernel.org
>Cc: linux-kernel@vger.kernel.org; robdclark@chromium.org;
>dianders@chromium.org; swboyd@chromium.org; Vinod Polimera (QUIC)
><quic_vpolimer@quicinc.com>; Abhinav Kumar (QUIC)
><quic_abhinavk@quicinc.com>
>Subject: Re: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is
>builtin
>
>WARNING: This email originated from outside of Qualcomm. Please be wary of
>any links or attachments, and do not enable macros.
>
>On 18/11/2022 15:16, Kalyan Thota wrote:
>> Since DRM encoder type for few encoders can be similar (like eDP and
>> DP) find out if the interface supports HPD from encoder bridge to
>> differentiate between builtin and pluggable displays.
>>
>> Changes in v1:
>> - add connector type in the disp_info (Dmitry)
>> - add helper functions to know encoder type
>> - update commit text reflecting the change
>>
>> Changes in v2:
>> - avoid hardcode of connector type for DSI as it may not be true
>> (Dmitry)
>> - get the HPD information from encoder bridge
>>
>> Changes in v3:
>> - use bridge type instead of bridge ops in determining connector
>> (Dmitry)
>>
>> Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
>> ---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27
>+++++++++++++++++++++++++++
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 6 ++++++
>> 2 files changed, 33 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> index 9c6817b..574f2b0 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> @@ -15,6 +15,7 @@
>> #include <drm/drm_crtc.h>
>> #include <drm/drm_file.h>
>> #include <drm/drm_probe_helper.h>
>> +#include <drm/drm_bridge.h>
>>
>> #include "msm_drv.h"
>> #include "dpu_kms.h"
>> @@ -217,6 +218,32 @@ static u32 dither_matrix[DITHER_MATRIX_SZ] = {
>> 15, 7, 13, 5, 3, 11, 1, 9, 12, 4, 14, 6, 0, 8, 2, 10
>> };
>>
>> +bool dpu_encoder_is_builtin(struct drm_encoder *encoder) {
>> + struct drm_bridge *bridge;
>> + int ops = 0;
>> +
>> + if (!encoder)
>> + return false;
>> +
>> + /* Get last bridge in the chain to determine connector type */
>> + drm_for_each_bridge_in_chain(encoder, bridge)
>> + if (!drm_bridge_get_next_bridge(bridge))
>> + ops = bridge->type;
>
>Why don't we check the connector type directly? You should not assume that
>connector's type is equal to the latest bridge's type.
if we need to get the type from connector, need to do something as below.
Are you thinking on the same lines ?
"to_drm_bridge_connector" macro needs to be moved to drm_bridge_connector.h
struct drm_bridge_connector *bridge_connector;
drm_connector_list_iter_begin(dev, &conn_iter);
drm_for_each_connector_iter(connector, &conn_iter) {
bridge_connector = to_drm_bridge_connector(connector);
if (bridge_connector->encoder == encoder) {
type = connector->connector_type;
break;
}
}
drm_connector_list_iter_end(&conn_iter);
>> +
>> + switch (ops) {
>> + case DRM_MODE_CONNECTOR_Unknown:
>> + case DRM_MODE_CONNECTOR_LVDS:
>> + case DRM_MODE_CONNECTOR_eDP:
>> + case DRM_MODE_CONNECTOR_DSI:
>> + case DRM_MODE_CONNECTOR_DPI:
>> + case DRM_MODE_CONNECTOR_WRITEBACK:
>> + case DRM_MODE_CONNECTOR_VIRTUAL:
>
>Unknown, WRITEBACK and VIRTUAL are not builtin (for the point of CTM at
>least).
>
>> + return true;
>> + default:
>> + return false;
>> + }
>> +}
>>
>> bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)
>> {
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> index 9e7236e..7f3d823 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>> @@ -224,4 +224,10 @@ void dpu_encoder_cleanup_wb_job(struct
>drm_encoder *drm_enc,
>> */
>> bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc);
>>
>> +/**
>> + * dpu_encoder_is_builtin - find if the encoder is of type builtin
>> + * @drm_enc: Pointer to previously created drm encoder structure
>> + */
>> +bool dpu_encoder_is_builtin(struct drm_encoder *drm_enc);
>> +
>> #endif /* __DPU_ENCODER_H__ */
>
>--
>With best wishes
>Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin
2022-11-18 14:37 ` Kalyan Thota
@ 2022-11-18 15:00 ` Dmitry Baryshkov
0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2022-11-18 15:00 UTC (permalink / raw)
To: Kalyan Thota, Kalyan Thota (QUIC),
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org, devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, robdclark@chromium.org,
dianders@chromium.org, swboyd@chromium.org, Vinod Polimera (QUIC),
Abhinav Kumar (QUIC)
On 18/11/2022 16:37, Kalyan Thota wrote:
>
>
>> -----Original Message-----
>> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> Sent: Friday, November 18, 2022 6:09 PM
>> To: Kalyan Thota (QUIC) <quic_kalyant@quicinc.com>; dri-
>> devel@lists.freedesktop.org; linux-arm-msm@vger.kernel.org;
>> freedreno@lists.freedesktop.org; devicetree@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org; robdclark@chromium.org;
>> dianders@chromium.org; swboyd@chromium.org; Vinod Polimera (QUIC)
>> <quic_vpolimer@quicinc.com>; Abhinav Kumar (QUIC)
>> <quic_abhinavk@quicinc.com>
>> Subject: Re: [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is
>> builtin
>>
>> WARNING: This email originated from outside of Qualcomm. Please be wary of
>> any links or attachments, and do not enable macros.
>>
>> On 18/11/2022 15:16, Kalyan Thota wrote:
>>> Since DRM encoder type for few encoders can be similar (like eDP and
>>> DP) find out if the interface supports HPD from encoder bridge to
>>> differentiate between builtin and pluggable displays.
>>>
>>> Changes in v1:
>>> - add connector type in the disp_info (Dmitry)
>>> - add helper functions to know encoder type
>>> - update commit text reflecting the change
>>>
>>> Changes in v2:
>>> - avoid hardcode of connector type for DSI as it may not be true
>>> (Dmitry)
>>> - get the HPD information from encoder bridge
>>>
>>> Changes in v3:
>>> - use bridge type instead of bridge ops in determining connector
>>> (Dmitry)
>>>
>>> Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
>>> ---
>>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27
>> +++++++++++++++++++++++++++
>>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 6 ++++++
>>> 2 files changed, 33 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> index 9c6817b..574f2b0 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>> @@ -15,6 +15,7 @@
>>> #include <drm/drm_crtc.h>
>>> #include <drm/drm_file.h>
>>> #include <drm/drm_probe_helper.h>
>>> +#include <drm/drm_bridge.h>
>>>
>>> #include "msm_drv.h"
>>> #include "dpu_kms.h"
>>> @@ -217,6 +218,32 @@ static u32 dither_matrix[DITHER_MATRIX_SZ] = {
>>> 15, 7, 13, 5, 3, 11, 1, 9, 12, 4, 14, 6, 0, 8, 2, 10
>>> };
>>>
>>> +bool dpu_encoder_is_builtin(struct drm_encoder *encoder) {
>>> + struct drm_bridge *bridge;
>>> + int ops = 0;
>>> +
>>> + if (!encoder)
>>> + return false;
>>> +
>>> + /* Get last bridge in the chain to determine connector type */
>>> + drm_for_each_bridge_in_chain(encoder, bridge)
>>> + if (!drm_bridge_get_next_bridge(bridge))
>>> + ops = bridge->type;
>>
>> Why don't we check the connector type directly? You should not assume that
>> connector's type is equal to the latest bridge's type.
>
> if we need to get the type from connector, need to do something as below.
> Are you thinking on the same lines ?
>
> "to_drm_bridge_connector" macro needs to be moved to drm_bridge_connector.h
>
> struct drm_bridge_connector *bridge_connector;
>
> drm_connector_list_iter_begin(dev, &conn_iter);
> drm_for_each_connector_iter(connector, &conn_iter) {
>
> bridge_connector = to_drm_bridge_connector(connector);
> if (bridge_connector->encoder == encoder) {
> type = connector->connector_type;
> break;
> }
> }
> drm_connector_list_iter_end(&conn_iter);
No. You can not depend on the idea that every connector is
drm_bridge_connector. Some bridges might create their own connectors.
However you can do it in the following way:
drm_connector_list_iter_begin(dev, &iter);
drm_for_each_connector_iter(connector, &iter) {
if (connector->possible_encoders & drm_encoder_mask(encoder)) {
builtin = (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) ||
...;
break;
}
}
drm_connector_list_iter_end(&iter);
return builtin;
>
>
>>> +
>>> + switch (ops) {
>>> + case DRM_MODE_CONNECTOR_Unknown:
>>> + case DRM_MODE_CONNECTOR_LVDS:
>>> + case DRM_MODE_CONNECTOR_eDP:
>>> + case DRM_MODE_CONNECTOR_DSI:
>>> + case DRM_MODE_CONNECTOR_DPI:
>>> + case DRM_MODE_CONNECTOR_WRITEBACK:
>>> + case DRM_MODE_CONNECTOR_VIRTUAL:
>>
>> Unknown, WRITEBACK and VIRTUAL are not builtin (for the point of CTM at
>> least).
>>
>>> + return true;
>>> + default:
>>> + return false;
>>> + }
>>> +}
>>>
>>> bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc)
>>> {
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>>> index 9e7236e..7f3d823 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
>>> @@ -224,4 +224,10 @@ void dpu_encoder_cleanup_wb_job(struct
>> drm_encoder *drm_enc,
>>> */
>>> bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc);
>>>
>>> +/**
>>> + * dpu_encoder_is_builtin - find if the encoder is of type builtin
>>> + * @drm_enc: Pointer to previously created drm encoder structure
>>> + */
>>> +bool dpu_encoder_is_builtin(struct drm_encoder *drm_enc);
>>> +
>>> #endif /* __DPU_ENCODER_H__ */
>>
>> --
>> With best wishes
>> Dmitry
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-11-18 15:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-18 12:16 [PATCH v3 0/3] add color management support for the crtc Kalyan Thota
2022-11-18 12:16 ` [PATCH v3 1/3] drm/msm/disp/dpu1: pin 1 crtc to 1 encoder Kalyan Thota
2022-11-18 12:36 ` Dmitry Baryshkov
2022-11-18 12:16 ` [PATCH v3 2/3] drm/msm/disp/dpu1: add helper to know if display is builtin Kalyan Thota
2022-11-18 12:38 ` Dmitry Baryshkov
2022-11-18 14:37 ` Kalyan Thota
2022-11-18 15:00 ` Dmitry Baryshkov
2022-11-18 12:16 ` [PATCH v3 3/3] drm/msm/disp/dpu1: add color management support for the crtc Kalyan Thota
2022-11-18 12:40 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).