Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1421814 > unrolled thread
| Started by | Yakir Yang <ykk@rock-chips.com> |
|---|---|
| First post | 2016-06-14 13:50 +0200 |
| Last post | 2016-06-29 08:50 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v3 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc Yakir Yang <ykk@rock-chips.com> - 2016-06-14 13:50 +0200
Re: [PATCH v3 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc Sean Paul <seanpaul@chromium.org> - 2016-06-23 16:30 +0200
Re: [PATCH v3 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc Yakir Yang <ykk@rock-chips.com> - 2016-06-29 08:50 +0200
| From | Yakir Yang <ykk@rock-chips.com> |
|---|---|
| Date | 2016-06-14 13:50 +0200 |
| Subject | [PATCH v3 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc |
| Message-ID | <rJV0Z-4hM-1@gated-at.bofh.it> |
Rockchip VOP couldn't output YUV video format for eDP controller, so
when driver detect connector support YUV video format, we need to hack
it down to RGB888.
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Acked-by: Mark Yao <mark.yao@rock-chips.com>
---
Changes in v3:
- Hook the connector's color_formats in .get_modes directly. (Tomasz, reviewed at Google Gerrit)
[https://chromium-review.googlesource.com/#/c/346317/15]
- Add the acked flag from Mark.
Changes in v2: None
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index da2e844..95a6f60 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -102,6 +102,22 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
return 0;
}
+static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
+ struct drm_connector *connector)
+{
+ struct drm_display_info *di = &connector->display_info;
+
+ if (di->color_formats & DRM_COLOR_FORMAT_YCRCB444 ||
+ di->color_formats & DRM_COLOR_FORMAT_YCRCB422) {
+ di->color_formats &= ~(DRM_COLOR_FORMAT_YCRCB422 |
+ DRM_COLOR_FORMAT_YCRCB444);
+ di->color_formats |= DRM_COLOR_FORMAT_RGB444;
+ di->bpc = 8;
+ }
+
+ return 0;
+}
+
static bool
rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
@@ -313,6 +329,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
dp->plat_data.subdev_type = dp_data->chip_type;
dp->plat_data.power_on = rockchip_dp_poweron;
dp->plat_data.power_off = rockchip_dp_powerdown;
+ dp->plat_data.get_modes = rockchip_dp_get_modes;
return analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data);
}
--
1.9.1
[toc] | [next] | [standalone]
| From | Sean Paul <seanpaul@chromium.org> |
|---|---|
| Date | 2016-06-23 16:30 +0200 |
| Subject | Re: [PATCH v3 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc |
| Message-ID | <rNdNL-2OV-1@gated-at.bofh.it> |
| In reply to | #1421814 |
On Tue, Jun 14, 2016 at 7:46 AM, Yakir Yang <ykk@rock-chips.com> wrote:
> Rockchip VOP couldn't output YUV video format for eDP controller, so
> when driver detect connector support YUV video format, we need to hack
> it down to RGB888.
>
> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
> Acked-by: Mark Yao <mark.yao@rock-chips.com>
> ---
> Changes in v3:
> - Hook the connector's color_formats in .get_modes directly. (Tomasz, reviewed at Google Gerrit)
> [https://chromium-review.googlesource.com/#/c/346317/15]
> - Add the acked flag from Mark.
>
> Changes in v2: None
>
> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index da2e844..95a6f60 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -102,6 +102,22 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
> return 0;
> }
>
> +static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
> + struct drm_connector *connector)
> +{
> + struct drm_display_info *di = &connector->display_info;
> +
> + if (di->color_formats & DRM_COLOR_FORMAT_YCRCB444 ||
> + di->color_formats & DRM_COLOR_FORMAT_YCRCB422) {
> + di->color_formats &= ~(DRM_COLOR_FORMAT_YCRCB422 |
> + DRM_COLOR_FORMAT_YCRCB444);
> + di->color_formats |= DRM_COLOR_FORMAT_RGB444;
> + di->bpc = 8;
Probably a stupid question, but are you guaranteed that the panel will
support this color format?
> + }
> +
I think this can be simplified as follows:
/* A comment here about why we're doing this */
u32 mask = DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCRCB422;
if ((di->color_formats & mask)) {
DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
di->color_formats &= ~mask;
di->color_formats |= DRM_COLOR_FORMAT_RGB444;
di->bpc = 8;
}
> + return 0;
> +}
> +
> static bool
> rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
> const struct drm_display_mode *mode,
> @@ -313,6 +329,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
> dp->plat_data.subdev_type = dp_data->chip_type;
> dp->plat_data.power_on = rockchip_dp_poweron;
> dp->plat_data.power_off = rockchip_dp_powerdown;
> + dp->plat_data.get_modes = rockchip_dp_get_modes;
>
> return analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data);
> }
> --
> 1.9.1
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
[toc] | [prev] | [next] | [standalone]
| From | Yakir Yang <ykk@rock-chips.com> |
|---|---|
| Date | 2016-06-29 08:50 +0200 |
| Subject | Re: [PATCH v3 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc |
| Message-ID | <rPhtT-NA-5@gated-at.bofh.it> |
| In reply to | #1429886 |
Sean,
On 06/23/2016 10:19 PM, Sean Paul wrote:
> On Tue, Jun 14, 2016 at 7:46 AM, Yakir Yang <ykk@rock-chips.com> wrote:
>> Rockchip VOP couldn't output YUV video format for eDP controller, so
>> when driver detect connector support YUV video format, we need to hack
>> it down to RGB888.
>>
>> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
>> Acked-by: Mark Yao <mark.yao@rock-chips.com>
>> ---
>> Changes in v3:
>> - Hook the connector's color_formats in .get_modes directly. (Tomasz, reviewed at Google Gerrit)
>> [https://chromium-review.googlesource.com/#/c/346317/15]
>> - Add the acked flag from Mark.
>>
>> Changes in v2: None
>>
>> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> index da2e844..95a6f60 100644
>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> @@ -102,6 +102,22 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
>> return 0;
>> }
>>
>> +static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
>> + struct drm_connector *connector)
>> +{
>> + struct drm_display_info *di = &connector->display_info;
>> +
>> + if (di->color_formats & DRM_COLOR_FORMAT_YCRCB444 ||
>> + di->color_formats & DRM_COLOR_FORMAT_YCRCB422) {
>> + di->color_formats &= ~(DRM_COLOR_FORMAT_YCRCB422 |
>> + DRM_COLOR_FORMAT_YCRCB444);
>> + di->color_formats |= DRM_COLOR_FORMAT_RGB444;
>> + di->bpc = 8;
> Probably a stupid question, but are you guaranteed that the panel will
> support this color format?
Hmm... I'm not sure, but it works on my several panels. I guess RGB is
more common then YUV, so if panel support YUV format, it should support
RGB888 too.
>> + }
>> +
> I think this can be simplified as follows:
>
> /* A comment here about why we're doing this */
> u32 mask = DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCRCB422;
> if ((di->color_formats & mask)) {
> DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
> di->color_formats &= ~mask;
> di->color_formats |= DRM_COLOR_FORMAT_RGB444;
> di->bpc = 8;
> }
Done, good idea.
Thanks,
- Yakir
>> + return 0;
>> +}
>> +
>> static bool
>> rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
>> const struct drm_display_mode *mode,
>> @@ -313,6 +329,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
>> dp->plat_data.subdev_type = dp_data->chip_type;
>> dp->plat_data.power_on = rockchip_dp_poweron;
>> dp->plat_data.power_off = rockchip_dp_powerdown;
>> + dp->plat_data.get_modes = rockchip_dp_get_modes;
>>
>> return analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data);
>> }
>> --
>> 1.9.1
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web