Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int axi_hdmi_platform_probe(struct platform_device *pdev)
if (private->version == AXI_HDMI_LEGACY &&
of_property_read_bool(np, "adi,embedded-sync"))
private->version = AXI_HDMI_LEGACY_ES;

private->encoder_slave = of_find_i2c_device_by_node(slave_node);
of_node_put(slave_node);

Expand Down
15 changes: 10 additions & 5 deletions drivers/gpu/drm/adi_axi_hdmi/axi_hdmi_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_encoder_slave.h>
#include <drm/drm_edid.h>

#include "axi_hdmi_drv.h"

Expand Down Expand Up @@ -264,10 +265,14 @@ static void axi_hdmi_encoder_dpms(struct drm_encoder *encoder, int mode)
writel(AXI_HDMI_RESET_ENABLE, private->base + AXI_HDMI_REG_RESET);
else
writel(AXI_HDMI_LEGACY_CTRL_ENABLE, private->base + AXI_HDMI_LEGACY_REG_CTRL);
edid = adv7511_get_edid(encoder);

if (!connector)
edid = NULL;
else
edid = drm_connector_get_edid(connector);

if (edid) {
config.hdmi_mode = drm_detect_hdmi_monitor(edid);
kfree(edid);
} else {
config.hdmi_mode = false;
}
Expand All @@ -292,8 +297,8 @@ static void axi_hdmi_encoder_dpms(struct drm_encoder *encoder, int mode)
config.avi_infoframe.colorspace = HDMI_COLORSPACE_RGB;
}
}

sfuncs->set_config(encoder, &config);
if (sfuncs && sfuncs->set_config)
sfuncs->set_config(encoder, &config);
break;
default:
if (private->version == AXI_HDMI)
Expand Down Expand Up @@ -338,7 +343,7 @@ static void axi_hdmi_encoder_mode_set(struct drm_encoder *encoder,
h_de_max = h_de_min + mode->hdisplay;
v_de_min = mode->vtotal - mode->vsync_start;
v_de_max = v_de_min + mode->vdisplay;

switch (private->version) {
case AXI_HDMI:
val = (mode->hdisplay << 16) | mode->htotal;
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/i2c/adv7511.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ struct adv7511_link_config {

/**
adi,input-style = 1|2|3;
adi,input-id =
adi,input-id =
"24-bit-rgb444-ycbcr444",
"16-20-24-bit-ycbcr422-separate-sync" |
"16-20-24-bit-ycbcr422-embedded-sync" |
Expand Down Expand Up @@ -451,6 +451,4 @@ struct adv7511 {
int gpio_pd;
};

struct edid *adv7511_get_edid(struct drm_encoder *encoder);

#endif
20 changes: 4 additions & 16 deletions drivers/gpu/drm/i2c/adv7511_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,18 +472,6 @@ static int adv7511_get_modes(struct drm_encoder *encoder,
return count;
}

struct edid *adv7511_get_edid(struct drm_encoder *encoder)
{
struct adv7511 *adv7511 = encoder_to_adv7511(encoder);

if (!adv7511->edid)
return NULL;

return kmemdup(adv7511->edid, sizeof(*adv7511->edid) +
adv7511->edid->extensions * 128, GFP_KERNEL);
}
EXPORT_SYMBOL_GPL(adv7511_get_edid);

static void adv7511_encoder_dpms(struct drm_encoder *encoder, int mode)
{
struct adv7511 *adv7511 = encoder_to_adv7511(encoder);
Expand Down Expand Up @@ -680,8 +668,8 @@ static const struct regmap_config adv7511_regmap_config = {
};

/*
adi,input-id -
0x00:
adi,input-id -
0x00:
0x01:
0x02:
0x03:
Expand All @@ -696,7 +684,7 @@ static const struct regmap_config adv7511_regmap_config = {
0x00: Evently
0x01: Right
0x02: Left
adi,up-conversion -
adi,up-conversion -
0x00: zero-order up conversion
0x01: first-order up conversion
adi,timing-generation-sequence -
Expand Down Expand Up @@ -725,7 +713,7 @@ static const struct regmap_config adv7511_regmap_config = {
0x02: Use input style 1
0x01: Use input style 2
0x03: Use Input style 3
adi,input-color-depth - Selects the input format color depth
adi,input-color-depth - Selects the input format color depth
0x03: 8-bit per channel
0x01: 10-bit per channel
0x02: 12-bit per channel
Expand Down
15 changes: 15 additions & 0 deletions include/drm/drm_edid.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,21 @@ static inline int drm_eld_size(const uint8_t *eld)
return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4;
}

/**
* drm_connector_get_edid - Get current EDID from the given connector
* @connector: pointer to the connector stucture
*
* This is a helper for accessing the drm blob buffered in the connector
* struct (if any)
*/
static inline struct edid *drm_connector_get_edid(struct drm_connector *connector)
{
if (!connector->edid_blob_ptr)
return NULL;

return (struct edid *)connector->edid_blob_ptr->data;
}

struct edid *drm_do_get_edid(struct drm_connector *connector,
int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
size_t len),
Expand Down