Skip to content

Commit

Permalink
ANDROID: GKI: Add 'dsc_info' to struct drm_dp_mst_port
Browse files Browse the repository at this point in the history
Resolves an abi diff. Also adds setter/getter functions which are also
exported.

Bug: 152417756
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ieb567ae1915446720ed2e77651a9a49f1e295360
  • Loading branch information
adelva1984 committed Apr 18, 2020
1 parent 27ac613 commit b572376
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
36 changes: 36 additions & 0 deletions drivers/gpu/drm/drm_dp_mst_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,42 @@ int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr,
}
EXPORT_SYMBOL(drm_dp_send_power_updown_phy);

int drm_dp_mst_get_dsc_info(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port,
struct drm_dp_mst_dsc_info *dsc_info)
{
if (!dsc_info)
return -EINVAL;

port = drm_dp_get_validated_port_ref(mgr, port);
if (!port)
return -EINVAL;

memcpy(dsc_info, &port->dsc_info, sizeof(struct drm_dp_mst_dsc_info));
drm_dp_put_port(port);

return 0;
}
EXPORT_SYMBOL_GPL(drm_dp_mst_get_dsc_info);

int drm_dp_mst_update_dsc_info(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port,
struct drm_dp_mst_dsc_info *dsc_info)
{
if (!dsc_info)
return -EINVAL;

port = drm_dp_get_validated_port_ref(mgr, port);
if (!port)
return -EINVAL;

memcpy(&port->dsc_info, dsc_info, sizeof(struct drm_dp_mst_dsc_info));
drm_dp_put_port(port);

return 0;
}
EXPORT_SYMBOL_GPL(drm_dp_mst_update_dsc_info);

static int drm_dp_create_payload_step1(struct drm_dp_mst_topology_mgr *mgr,
int id,
struct drm_dp_payload *payload)
Expand Down
23 changes: 23 additions & 0 deletions include/drm/drm_dp_mst_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <drm/drm_atomic.h>

struct drm_dp_mst_branch;
struct drm_dp_mst_port;

/**
* struct drm_dp_vcpi - Virtual Channel Payload Identifier
Expand All @@ -42,6 +43,18 @@ struct drm_dp_vcpi {
int num_slots;
};

struct drm_dp_mst_dsc_dpcd_cache {
bool valid;
bool use_parent_dpcd;
u8 dsc_dpcd[16];
};

struct drm_dp_mst_dsc_info {
bool dsc_support;
struct drm_dp_mst_port *dsc_port;
struct drm_dp_mst_dsc_dpcd_cache dsc_dpcd_cache;
};

/**
* struct drm_dp_mst_port - MST port
* @kref: reference count for this port.
Expand Down Expand Up @@ -100,6 +113,8 @@ struct drm_dp_mst_port {
bool has_audio;

bool fec_capable;

struct drm_dp_mst_dsc_info dsc_info;
};

/**
Expand Down Expand Up @@ -637,4 +652,12 @@ int drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state,
int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port, bool power_up);

int drm_dp_mst_get_dsc_info(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port,
struct drm_dp_mst_dsc_info *dsc_info);

int drm_dp_mst_update_dsc_info(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port,
struct drm_dp_mst_dsc_info *dsc_info);

#endif

0 comments on commit b572376

Please sign in to comment.