From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 11/12] drm/edid: add more general struct edid constness in the interfaces
Date: Mon, 28 Mar 2022 20:41:06 +0300 [thread overview]
Message-ID: <YkHzMoSxLhsEWnvY@intel.com> (raw)
In-Reply-To: <c7156f22494b585c55a00a6732462bde0cc19dbf.1648477901.git.jani.nikula@intel.com>
On Mon, Mar 28, 2022 at 05:34:32PM +0300, Jani Nikula wrote:
> With this, the remaining non-const parts are the ones that actually
> modify the EDID, for example to fix corrupt EDID.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 21 +++++++++++----------
> include/drm/drm_edid.h | 10 +++++-----
> 2 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 625fa6a4a93a..d1abaa517867 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2150,7 +2150,7 @@ static u32 edid_extract_panel_id(const struct edid *edid)
>
> u32 drm_edid_get_panel_id(struct i2c_adapter *adapter)
> {
> - struct edid *edid;
> + const struct edid *edid;
> u32 panel_id;
>
> edid = drm_do_get_edid_base_block(NULL, drm_do_probe_ddc_edid, adapter);
> @@ -3664,7 +3664,7 @@ static bool drm_valid_hdmi_vic(u8 vic)
> }
>
> static int
> -add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid)
> +add_alternate_cea_modes(struct drm_connector *connector, const struct edid *edid)
> {
> struct drm_device *dev = connector->dev;
> struct drm_display_mode *mode, *tmp;
> @@ -4345,7 +4345,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector,
> }
>
> static int
> -add_cea_modes(struct drm_connector *connector, struct edid *edid)
> +add_cea_modes(struct drm_connector *connector, const struct edid *edid)
> {
> const u8 *cea = drm_find_cea_extension(edid);
> const u8 *db, *hdmi = NULL, *video = NULL;
> @@ -4551,7 +4551,7 @@ static int get_monitor_name(const struct edid *edid, char name[13])
> * @bufsize: The size of the name buffer (should be at least 14 chars.)
> *
> */
> -void drm_edid_get_monitor_name(struct edid *edid, char *name, int bufsize)
> +void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize)
> {
> int name_length;
> char buf[13];
> @@ -4585,7 +4585,8 @@ static void clear_eld(struct drm_connector *connector)
> * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
> * HDCP and Port_ID ELD fields are left for the graphics driver to fill in.
> */
> -static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
> +static void drm_edid_to_eld(struct drm_connector *connector,
> + const struct edid *edid)
> {
> uint8_t *eld = connector->eld;
> const u8 *cea;
> @@ -4681,7 +4682,7 @@ static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
> *
> * Return: The number of found SADs or negative number on error.
> */
> -int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads)
> +int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads)
> {
> int count = 0;
> int i, start, end, dbl;
> @@ -4743,7 +4744,7 @@ EXPORT_SYMBOL(drm_edid_to_sad);
> * Return: The number of found Speaker Allocation Blocks or negative number on
> * error.
> */
> -int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb)
> +int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb)
> {
> int count = 0;
> int i, start, end, dbl;
> @@ -4838,7 +4839,7 @@ EXPORT_SYMBOL(drm_av_sync_delay);
> *
> * Return: True if the monitor is HDMI, false if not or unknown.
> */
> -bool drm_detect_hdmi_monitor(struct edid *edid)
> +bool drm_detect_hdmi_monitor(const struct edid *edid)
> {
> const u8 *edid_ext;
> int i;
> @@ -4876,7 +4877,7 @@ EXPORT_SYMBOL(drm_detect_hdmi_monitor);
> *
> * Return: True if the monitor supports audio, false otherwise.
> */
> -bool drm_detect_monitor_audio(struct edid *edid)
> +bool drm_detect_monitor_audio(const struct edid *edid)
> {
> const u8 *edid_ext;
> int i, j;
> @@ -5543,7 +5544,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector,
> }
>
> static int add_displayid_detailed_modes(struct drm_connector *connector,
> - struct edid *edid)
> + const struct edid *edid)
> {
> const struct displayid_block *block;
> struct displayid_iter iter;
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 144c495b99c4..48b1bf9c315a 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -372,8 +372,8 @@ struct drm_connector;
> struct drm_connector_state;
> struct drm_display_mode;
>
> -int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
> -int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb);
> +int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads);
> +int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb);
> int drm_av_sync_delay(struct drm_connector *connector,
> const struct drm_display_mode *mode);
>
> @@ -569,8 +569,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
> int drm_add_override_edid_modes(struct drm_connector *connector);
>
> u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
> -bool drm_detect_hdmi_monitor(struct edid *edid);
> -bool drm_detect_monitor_audio(struct edid *edid);
> +bool drm_detect_hdmi_monitor(const struct edid *edid);
> +bool drm_detect_monitor_audio(const struct edid *edid);
> enum hdmi_quantization_range
> drm_default_rgb_quant_range(const struct drm_display_mode *mode);
> int drm_add_modes_noedid(struct drm_connector *connector,
> @@ -582,7 +582,7 @@ int drm_edid_header_is_valid(const u8 *raw_edid);
> bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
> bool *edid_corrupt);
> bool drm_edid_is_valid(struct edid *edid);
> -void drm_edid_get_monitor_name(struct edid *edid, char *name,
> +void drm_edid_get_monitor_name(const struct edid *edid, char *name,
> int buflen);
> struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
> int hsize, int vsize, int fresh,
> --
> 2.30.2
--
Ville Syrjälä
Intel
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 11/12] drm/edid: add more general struct edid constness in the interfaces
Date: Mon, 28 Mar 2022 20:41:06 +0300 [thread overview]
Message-ID: <YkHzMoSxLhsEWnvY@intel.com> (raw)
In-Reply-To: <c7156f22494b585c55a00a6732462bde0cc19dbf.1648477901.git.jani.nikula@intel.com>
On Mon, Mar 28, 2022 at 05:34:32PM +0300, Jani Nikula wrote:
> With this, the remaining non-const parts are the ones that actually
> modify the EDID, for example to fix corrupt EDID.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 21 +++++++++++----------
> include/drm/drm_edid.h | 10 +++++-----
> 2 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 625fa6a4a93a..d1abaa517867 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2150,7 +2150,7 @@ static u32 edid_extract_panel_id(const struct edid *edid)
>
> u32 drm_edid_get_panel_id(struct i2c_adapter *adapter)
> {
> - struct edid *edid;
> + const struct edid *edid;
> u32 panel_id;
>
> edid = drm_do_get_edid_base_block(NULL, drm_do_probe_ddc_edid, adapter);
> @@ -3664,7 +3664,7 @@ static bool drm_valid_hdmi_vic(u8 vic)
> }
>
> static int
> -add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid)
> +add_alternate_cea_modes(struct drm_connector *connector, const struct edid *edid)
> {
> struct drm_device *dev = connector->dev;
> struct drm_display_mode *mode, *tmp;
> @@ -4345,7 +4345,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector,
> }
>
> static int
> -add_cea_modes(struct drm_connector *connector, struct edid *edid)
> +add_cea_modes(struct drm_connector *connector, const struct edid *edid)
> {
> const u8 *cea = drm_find_cea_extension(edid);
> const u8 *db, *hdmi = NULL, *video = NULL;
> @@ -4551,7 +4551,7 @@ static int get_monitor_name(const struct edid *edid, char name[13])
> * @bufsize: The size of the name buffer (should be at least 14 chars.)
> *
> */
> -void drm_edid_get_monitor_name(struct edid *edid, char *name, int bufsize)
> +void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize)
> {
> int name_length;
> char buf[13];
> @@ -4585,7 +4585,8 @@ static void clear_eld(struct drm_connector *connector)
> * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
> * HDCP and Port_ID ELD fields are left for the graphics driver to fill in.
> */
> -static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
> +static void drm_edid_to_eld(struct drm_connector *connector,
> + const struct edid *edid)
> {
> uint8_t *eld = connector->eld;
> const u8 *cea;
> @@ -4681,7 +4682,7 @@ static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
> *
> * Return: The number of found SADs or negative number on error.
> */
> -int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads)
> +int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads)
> {
> int count = 0;
> int i, start, end, dbl;
> @@ -4743,7 +4744,7 @@ EXPORT_SYMBOL(drm_edid_to_sad);
> * Return: The number of found Speaker Allocation Blocks or negative number on
> * error.
> */
> -int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb)
> +int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb)
> {
> int count = 0;
> int i, start, end, dbl;
> @@ -4838,7 +4839,7 @@ EXPORT_SYMBOL(drm_av_sync_delay);
> *
> * Return: True if the monitor is HDMI, false if not or unknown.
> */
> -bool drm_detect_hdmi_monitor(struct edid *edid)
> +bool drm_detect_hdmi_monitor(const struct edid *edid)
> {
> const u8 *edid_ext;
> int i;
> @@ -4876,7 +4877,7 @@ EXPORT_SYMBOL(drm_detect_hdmi_monitor);
> *
> * Return: True if the monitor supports audio, false otherwise.
> */
> -bool drm_detect_monitor_audio(struct edid *edid)
> +bool drm_detect_monitor_audio(const struct edid *edid)
> {
> const u8 *edid_ext;
> int i, j;
> @@ -5543,7 +5544,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector,
> }
>
> static int add_displayid_detailed_modes(struct drm_connector *connector,
> - struct edid *edid)
> + const struct edid *edid)
> {
> const struct displayid_block *block;
> struct displayid_iter iter;
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 144c495b99c4..48b1bf9c315a 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -372,8 +372,8 @@ struct drm_connector;
> struct drm_connector_state;
> struct drm_display_mode;
>
> -int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
> -int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb);
> +int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads);
> +int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb);
> int drm_av_sync_delay(struct drm_connector *connector,
> const struct drm_display_mode *mode);
>
> @@ -569,8 +569,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
> int drm_add_override_edid_modes(struct drm_connector *connector);
>
> u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
> -bool drm_detect_hdmi_monitor(struct edid *edid);
> -bool drm_detect_monitor_audio(struct edid *edid);
> +bool drm_detect_hdmi_monitor(const struct edid *edid);
> +bool drm_detect_monitor_audio(const struct edid *edid);
> enum hdmi_quantization_range
> drm_default_rgb_quant_range(const struct drm_display_mode *mode);
> int drm_add_modes_noedid(struct drm_connector *connector,
> @@ -582,7 +582,7 @@ int drm_edid_header_is_valid(const u8 *raw_edid);
> bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
> bool *edid_corrupt);
> bool drm_edid_is_valid(struct edid *edid);
> -void drm_edid_get_monitor_name(struct edid *edid, char *name,
> +void drm_edid_get_monitor_name(const struct edid *edid, char *name,
> int buflen);
> struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
> int hsize, int vsize, int fresh,
> --
> 2.30.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2022-03-28 17:41 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 14:34 [Intel-gfx] [PATCH v3 00/12] drm/edid: constify EDID parsing, with fixes Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 01/12] drm/edid: don't modify EDID while parsing Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 02/12] drm/edid: fix reduced blanking support check Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:27 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:27 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 03/12] drm/edid: pass a timing pointer to is_display_descriptor() Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:28 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:28 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 04/12] drm/edid: pass a timing pointer to is_detailed_timing_descriptor() Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:29 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:29 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 05/12] drm/edid: use struct detailed_timing member access in is_rb() Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:29 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:29 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 06/12] drm/edid: use struct detailed_timing member access in gtf2 functions Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:34 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:34 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 07/12] drm/edid: constify struct detailed_timing in lower level parsing Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:35 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:35 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 08/12] drm/edid: constify struct detailed_timing in parsing callbacks Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:37 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:37 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 09/12] drm/edid: constify struct edid passed to detailed blocks Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:39 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:39 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 10/12] drm/edid: constify struct edid passed around in callbacks and closure Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:40 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:40 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 11/12] drm/edid: add more general struct edid constness in the interfaces Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:41 ` Ville Syrjälä [this message]
2022-03-28 17:41 ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 12/12] drm/edid: split drm_add_edid_modes() to two Jani Nikula
2022-03-28 14:34 ` Jani Nikula
2022-03-28 17:48 ` [Intel-gfx] " Ville Syrjälä
2022-03-28 17:48 ` Ville Syrjälä
2022-03-28 18:35 ` [Intel-gfx] " Jani Nikula
2022-03-28 18:35 ` Jani Nikula
2022-03-28 18:00 ` [Intel-gfx] [PATCH v3 00/12] drm/edid: constify EDID parsing, with fixes Emil Velikov
2022-03-28 18:00 ` Emil Velikov
2022-03-28 18:36 ` [Intel-gfx] " Jani Nikula
2022-03-28 18:36 ` Jani Nikula
2022-03-29 1:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: constify EDID parsing, with fixes (rev2) Patchwork
2022-03-29 1:30 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-29 1:34 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-29 1:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-29 4:35 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-03-29 9:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: constify EDID parsing, with fixes (rev3) Patchwork
2022-03-29 9:23 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-29 9:27 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-29 9:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-29 12:55 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YkHzMoSxLhsEWnvY@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.