video: edid: guard standard timings EDID expansion behind kconfig
Since EDID only indicates supported standard timings, a large table with detailed timing information is necessary, consuming significant space. To mitigate this, the table is made configurable via kconfig, allowing it to be excluded when not needed. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
|
#if CONFIG_IS_ENABLED(I2C_EDID_STANDARD)
|
||||||
#define TIMING(c, ha, hfp, hbp, hsl, va, vfp, vbp, vsl, f) \
|
#define TIMING(c, ha, hfp, hbp, hsl, va, vfp, vbp, vsl, f) \
|
||||||
.pixelclock = { (c), (c), (c) }, \
|
.pixelclock = { (c), (c), (c) }, \
|
||||||
.hactive = { (ha), (ha), (ha) }, \
|
.hactive = { (ha), (ha), (ha) }, \
|
||||||
@@ -206,6 +207,7 @@ static const struct display_timing dmt_timings[] = {
|
|||||||
{ TIMING(556188000, 4096, 8, 32, 40, 2160, 48, 8, 6,
|
{ TIMING(556188000, 4096, 8, 32, 40, 2160, 48, 8, 6,
|
||||||
DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_LOW) },
|
DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_LOW) },
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int edid_check_info(struct edid1_info *edid_info)
|
int edid_check_info(struct edid1_info *edid_info)
|
||||||
{
|
{
|
||||||
@@ -417,6 +419,7 @@ static bool edid_get_standard_timing(struct edid1_info *edid, int i, unsigned in
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_IS_ENABLED(I2C_EDID_STANDARD)
|
||||||
static bool edid_find_valid_standard_timing(struct edid1_info *buf,
|
static bool edid_find_valid_standard_timing(struct edid1_info *buf,
|
||||||
struct display_timing *timing,
|
struct display_timing *timing,
|
||||||
bool (*mode_valid)(void *priv,
|
bool (*mode_valid)(void *priv,
|
||||||
@@ -446,6 +449,7 @@ static bool edid_find_valid_standard_timing(struct edid1_info *buf,
|
|||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int edid_get_timing_validate(u8 *buf, int buf_size,
|
int edid_get_timing_validate(u8 *buf, int buf_size,
|
||||||
struct display_timing *timing,
|
struct display_timing *timing,
|
||||||
@@ -493,10 +497,12 @@ int edid_get_timing_validate(u8 *buf, int buf_size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_IS_ENABLED(I2C_EDID_STANDARD)
|
||||||
/* Look for timing in Standard Timings */
|
/* Look for timing in Standard Timings */
|
||||||
if (!found)
|
if (!found)
|
||||||
found = edid_find_valid_standard_timing(edid, timing, mode_valid,
|
found = edid_find_valid_standard_timing(edid, timing, mode_valid,
|
||||||
mode_valid_priv);
|
mode_valid_priv);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@@ -721,6 +721,12 @@ config I2C_EDID
|
|||||||
help
|
help
|
||||||
This enables library for accessing EDID data from an LCD panel.
|
This enables library for accessing EDID data from an LCD panel.
|
||||||
|
|
||||||
|
config I2C_EDID_STANDARD
|
||||||
|
bool "Enable standard timings EDID library expansion"
|
||||||
|
depends on I2C_EDID
|
||||||
|
help
|
||||||
|
This enables standard timings expansion for EDID data from an LCD panel.
|
||||||
|
|
||||||
config DISPLAY
|
config DISPLAY
|
||||||
bool "Enable Display support"
|
bool "Enable Display support"
|
||||||
depends on DM
|
depends on DM
|
||||||
|
Reference in New Issue
Block a user