Commit 935f7950 authored by Martin Krastev's avatar Martin Krastev Committed by Zack Rusin

drm/vmwgfx: Refactor drm connector probing for display modes

Implement drm_connector_helper_funcs.mode_valid and .get_modes,
replacing custom drm_connector_funcs.fill_modes code with
drm_helper_probe_single_connector_modes; for STDU, LDU & SOU
display units.
Signed-off-by: default avatarMartin Krastev <martin.krastev@broadcom.com>
Reviewed-by: default avatarZack Rusin <zack.rusin@broadcom.com>
Signed-off-by: default avatarZack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-2-zack.rusin@broadcom.com
parent 4db102dc
This diff is collapsed.
...@@ -378,7 +378,6 @@ struct vmw_display_unit { ...@@ -378,7 +378,6 @@ struct vmw_display_unit {
unsigned pref_width; unsigned pref_width;
unsigned pref_height; unsigned pref_height;
bool pref_active; bool pref_active;
struct drm_display_mode *pref_mode;
/* /*
* Gui positioning * Gui positioning
...@@ -428,8 +427,6 @@ void vmw_du_connector_save(struct drm_connector *connector); ...@@ -428,8 +427,6 @@ void vmw_du_connector_save(struct drm_connector *connector);
void vmw_du_connector_restore(struct drm_connector *connector); void vmw_du_connector_restore(struct drm_connector *connector);
enum drm_connector_status enum drm_connector_status
vmw_du_connector_detect(struct drm_connector *connector, bool force); vmw_du_connector_detect(struct drm_connector *connector, bool force);
int vmw_du_connector_fill_modes(struct drm_connector *connector,
uint32_t max_width, uint32_t max_height);
int vmw_kms_helper_dirty(struct vmw_private *dev_priv, int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer, struct vmw_framebuffer *framebuffer,
const struct drm_clip_rect *clips, const struct drm_clip_rect *clips,
...@@ -438,6 +435,9 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv, ...@@ -438,6 +435,9 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
int num_clips, int num_clips,
int increment, int increment,
struct vmw_kms_dirty *dirty); struct vmw_kms_dirty *dirty);
enum drm_mode_status vmw_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode);
int vmw_connector_get_modes(struct drm_connector *connector);
void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv, void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv,
struct drm_file *file_priv, struct drm_file *file_priv,
......
...@@ -304,7 +304,7 @@ static void vmw_ldu_connector_destroy(struct drm_connector *connector) ...@@ -304,7 +304,7 @@ static void vmw_ldu_connector_destroy(struct drm_connector *connector)
static const struct drm_connector_funcs vmw_legacy_connector_funcs = { static const struct drm_connector_funcs vmw_legacy_connector_funcs = {
.dpms = vmw_du_connector_dpms, .dpms = vmw_du_connector_dpms,
.detect = vmw_du_connector_detect, .detect = vmw_du_connector_detect,
.fill_modes = vmw_du_connector_fill_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.destroy = vmw_ldu_connector_destroy, .destroy = vmw_ldu_connector_destroy,
.reset = vmw_du_connector_reset, .reset = vmw_du_connector_reset,
.atomic_duplicate_state = vmw_du_connector_duplicate_state, .atomic_duplicate_state = vmw_du_connector_duplicate_state,
...@@ -313,6 +313,8 @@ static const struct drm_connector_funcs vmw_legacy_connector_funcs = { ...@@ -313,6 +313,8 @@ static const struct drm_connector_funcs vmw_legacy_connector_funcs = {
static const struct static const struct
drm_connector_helper_funcs vmw_ldu_connector_helper_funcs = { drm_connector_helper_funcs vmw_ldu_connector_helper_funcs = {
.get_modes = vmw_connector_get_modes,
.mode_valid = vmw_connector_mode_valid
}; };
static int vmw_kms_ldu_do_bo_dirty(struct vmw_private *dev_priv, static int vmw_kms_ldu_do_bo_dirty(struct vmw_private *dev_priv,
...@@ -449,7 +451,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) ...@@ -449,7 +451,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
ldu->base.pref_active = (unit == 0); ldu->base.pref_active = (unit == 0);
ldu->base.pref_width = dev_priv->initial_width; ldu->base.pref_width = dev_priv->initial_width;
ldu->base.pref_height = dev_priv->initial_height; ldu->base.pref_height = dev_priv->initial_height;
ldu->base.pref_mode = NULL;
/* /*
* Remove this after enabling atomic because property values can * Remove this after enabling atomic because property values can
......
...@@ -347,7 +347,7 @@ static void vmw_sou_connector_destroy(struct drm_connector *connector) ...@@ -347,7 +347,7 @@ static void vmw_sou_connector_destroy(struct drm_connector *connector)
static const struct drm_connector_funcs vmw_sou_connector_funcs = { static const struct drm_connector_funcs vmw_sou_connector_funcs = {
.dpms = vmw_du_connector_dpms, .dpms = vmw_du_connector_dpms,
.detect = vmw_du_connector_detect, .detect = vmw_du_connector_detect,
.fill_modes = vmw_du_connector_fill_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.destroy = vmw_sou_connector_destroy, .destroy = vmw_sou_connector_destroy,
.reset = vmw_du_connector_reset, .reset = vmw_du_connector_reset,
.atomic_duplicate_state = vmw_du_connector_duplicate_state, .atomic_duplicate_state = vmw_du_connector_duplicate_state,
...@@ -357,6 +357,8 @@ static const struct drm_connector_funcs vmw_sou_connector_funcs = { ...@@ -357,6 +357,8 @@ static const struct drm_connector_funcs vmw_sou_connector_funcs = {
static const struct static const struct
drm_connector_helper_funcs vmw_sou_connector_helper_funcs = { drm_connector_helper_funcs vmw_sou_connector_helper_funcs = {
.get_modes = vmw_connector_get_modes,
.mode_valid = vmw_connector_mode_valid
}; };
...@@ -826,7 +828,6 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit) ...@@ -826,7 +828,6 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
sou->base.pref_active = (unit == 0); sou->base.pref_active = (unit == 0);
sou->base.pref_width = dev_priv->initial_width; sou->base.pref_width = dev_priv->initial_width;
sou->base.pref_height = dev_priv->initial_height; sou->base.pref_height = dev_priv->initial_height;
sou->base.pref_mode = NULL;
/* /*
* Remove this after enabling atomic because property values can * Remove this after enabling atomic because property values can
......
...@@ -835,7 +835,7 @@ static void vmw_stdu_connector_destroy(struct drm_connector *connector) ...@@ -835,7 +835,7 @@ static void vmw_stdu_connector_destroy(struct drm_connector *connector)
static const struct drm_connector_funcs vmw_stdu_connector_funcs = { static const struct drm_connector_funcs vmw_stdu_connector_funcs = {
.dpms = vmw_du_connector_dpms, .dpms = vmw_du_connector_dpms,
.detect = vmw_du_connector_detect, .detect = vmw_du_connector_detect,
.fill_modes = vmw_du_connector_fill_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.destroy = vmw_stdu_connector_destroy, .destroy = vmw_stdu_connector_destroy,
.reset = vmw_du_connector_reset, .reset = vmw_du_connector_reset,
.atomic_duplicate_state = vmw_du_connector_duplicate_state, .atomic_duplicate_state = vmw_du_connector_duplicate_state,
...@@ -845,6 +845,8 @@ static const struct drm_connector_funcs vmw_stdu_connector_funcs = { ...@@ -845,6 +845,8 @@ static const struct drm_connector_funcs vmw_stdu_connector_funcs = {
static const struct static const struct
drm_connector_helper_funcs vmw_stdu_connector_helper_funcs = { drm_connector_helper_funcs vmw_stdu_connector_helper_funcs = {
.get_modes = vmw_connector_get_modes,
.mode_valid = vmw_connector_mode_valid
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment