drm/connector: Share with non-atomic drivers the function to get the single encoder
Subsystems (8)
PATCH 1/2 drm/connector: Share with non-atomic drivers the function to get the single encoder
This 3 non-atomic drivers all have the same function getting the only encoder available in the connector, also atomic drivers have this fallback. So moving it a common place and sharing between atomic and non-atomic drivers.
While at it I also removed the mention of drm_atomic_helper_best_encoder() that was renamed in commit 297e30b5d9b6 ("drm/atomic-helper: Unexport drm_atomic_helper_best_encoder").
--- drivers/gpu/drm/ast/ast_mode.c | 12 ------------ drivers/gpu/drm/drm_atomic_helper.c | 15 ++------------- drivers/gpu/drm/drm_connector.c | 11 +++++++++++ drivers/gpu/drm/drm_crtc_helper.c | 8 +++++++- drivers/gpu/drm/drm_crtc_internal.h | 2 ++ drivers/gpu/drm/mgag200/mgag200_mode.c | 11 ----------- drivers/gpu/drm/udl/udl_connector.c | 8 -------- include/drm/drm_modeset_helper_vtables.h | 6 +++--- 8 files changed, 25 insertions(+), 48 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +0 -12
@@ -687,17 +687,6 @@ static void ast_encoder_destroy(struct drm_encoder *encoder)kfree (encoder); } - -static struct drm_encoder *ast_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} - -static const struct drm_encoder_funcs ast_enc_funcs = { .destroy = ast_encoder_destroy, };
@@ -847,7 +836,6 @@ static void ast_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs ast_connector_helper_funcs = { .mode_valid = ast_mode_valid, .get_modes = ast_get_modes, - .best_encoder = ast_best_single_encoder, };static const struct drm_connector_funcs ast_connector_funcs = {
drivers/gpu/drm/drm_atomic_helper.c +2 -13
@@ -97,17 +97,6 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, } } -/* -* For connectors that support multiple encoders, either the -* .atomic_best_encoder() or .best_encoder() operation must be implemented. -*/ -static struct drm_encoder * -pick_single_encoder_for_connector (struct drm_connector *connector) -{ -WARN_ON (connector->encoder_ids[1 ]); -return drm_encoder_find (connector->dev,NULL , connector->encoder_ids[0 ]); -} -static int handle_conflicting_encoders (struct drm_atomic_state *state,bool disable_conflicting_encoders) {
@@ -135,7 +124,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector);else - new_encoder =pick_single_encoder_for_connector (connector); + new_encoder =drm_connector_get_single_encoder (connector);if (new_encoder) {if (encoder_mask &drm_encoder_mask (new_encoder)) {
@@ -359,7 +348,7 @@ update_connector_routing(struct drm_atomic_state *state,else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector);else - new_encoder =pick_single_encoder_for_connector (connector); + new_encoder =drm_connector_get_single_encoder (connector);if (!new_encoder) { DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
drivers/gpu/drm/drm_connector.c +11 -0
@@ -2334,3 +2334,14 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,return tg; }EXPORT_SYMBOL (drm_mode_create_tile_group); + +/* +* For connectors that support multiple encoders, either the +* .atomic_best_encoder() or .best_encoder() operation must be implemented. +*/ +struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector) +{ +WARN_ON (connector->encoder_ids[1 ]); +return drm_encoder_find (connector->dev,NULL , connector->encoder_ids[0 ]); +}
drivers/gpu/drm/drm_crtc_helper.c +7 -1
@@ -48,6 +48,8 @@#include <drm/drm_print.h> #include <drm/drm_vblank.h> +#include "drm_crtc_internal.h" +/** * DOC: overview *
@@ -625,7 +627,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, new_encoder = connector->encoder;for (ro =0 ; ro < set->num_connectors; ro++) {if (set->connectors[ro] == connector) { - new_encoder = connector_funcs->best_encoder (connector); +if (connector_funcs->best_encoder) + new_encoder = connector_funcs->best_encoder (connector); +else + new_encoder =drm_connector_get_single_encoder (connector); +/* if we can't get an encoder for a connector we are setting now - then fail */ if (new_encoder ==NULL )
drivers/gpu/drm/drm_crtc_internal.h +2 -0
@@ -181,6 +181,8 @@ int drm_connector_set_obj_prop(struct drm_mode_object *obj,int drm_connector_create_standard_properties (struct drm_device *dev);const char *drm_get_connector_force_name (enum drm_connector_force force);void drm_connector_free_work_fn (struct work_struct *work); +struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector);/* IOCTL */ int drm_connector_property_set_ioctl(struct drm_device *dev,
drivers/gpu/drm/mgag200/mgag200_mode.c +0 -11
@@ -1638,16 +1638,6 @@ static enum drm_mode_status mga_vga_mode_valid(struct drm_connector *connector,return MODE_OK ; } -static struct drm_encoder *mga_connector_best_encoder (struct drm_connector - *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} -static void mga_connector_destroy (struct drm_connector *connector) {struct mga_connector *mga_connector =to_mga_connector (connector);
@@ -1659,7 +1649,6 @@ static void mga_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs mga_vga_connector_helper_funcs = { .get_modes = mga_vga_get_modes, .mode_valid = mga_vga_mode_valid, - .best_encoder = mga_connector_best_encoder, };static const struct drm_connector_funcs mga_vga_connector_funcs = {
drivers/gpu/drm/udl/udl_connector.c +0 -8
@@ -90,13 +90,6 @@ udl_detect(struct drm_connector *connector, bool force)return connector_status_connected; } -static struct drm_encoder * -udl_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -return drm_encoder_find (connector->dev,NULL , enc_id); -} -static int udl_connector_set_property (struct drm_connector *connector,struct drm_property *property,uint64_t val)
@@ -120,7 +113,6 @@ static void udl_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs udl_connector_helper_funcs = { .get_modes = udl_get_modes, .mode_valid = udl_mode_valid, - .best_encoder = udl_best_single_encoder, };static const struct drm_connector_funcs udl_connector_funcs = {
include/drm/drm_modeset_helper_vtables.h +3 -3
@@ -955,8 +955,8 @@ struct drm_connector_helper_funcs {* @atomic_best_encoder. * * You can leave this function to NULL if the connector is only -* attached to a single encoder and you are using the atomic helpers. -* In this case, the core will call drm_atomic_helper_best_encoder() +* attached to a single encoder. +* In this case, the core will call drm_connector_get_single_encoder() * for you. * * RETURNS:
@@ -977,7 +977,7 @@ struct drm_connector_helper_funcs {* * This function is used by drm_atomic_helper_check_modeset(). * If it is not implemented, the core will fallback to @best_encoder -* (or drm_atomic_helper_best_encoder() if @best_encoder is NULL). +* (or drm_connector_get_single_encoder() if @best_encoder is NULL). * * NOTE: *
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
A message that is not in the archive (sent off-list or not yet received): 20190911175603.30356-1-jose.souza-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
PATCH 2/2 drm/connector: Allow max possible encoders to attach to a connector
From: Dhinakaran Pandiyan <[email protected]>
Currently we restrict the number of encoders that can be linked to a connector to 3, increase it to match the maximum number of encoders that can be initialized(32).
To more effiently do that lets switch from an array of encoder ids to bitmask.
v2: Fixing missed return on amdgpu_dm_connector_to_encoder()
--- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 23 ++++------- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 5 +-- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +++- drivers/gpu/drm/drm_client_modeset.c | 3 +- drivers/gpu/drm/drm_connector.c | 40 +++++++------------ drivers/gpu/drm/drm_probe_helper.c | 3 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 7 ++-- drivers/gpu/drm/radeon/radeon_connectors.c | 27 +++++-------- include/drm/drm_connector.h | 18 ++++----- 11 files changed, 55 insertions(+), 83 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +8 -15
@@ -217,11 +217,10 @@ amdgpu_connector_update_scratch_regs(struct drm_connector *connector,struct drm_encoder *encoder;const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;bool connected; -int i; best_encoder = connector_funcs->best_encoder (connector); -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if ((encoder == best_encoder) && (status == connector_status_connected)) connected = true;else
@@ -236,9 +235,8 @@ amdgpu_connector_find_encoder(struct drm_connector *connector, int encoder_type) {struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (encoder->encoder_type == encoder_type)return encoder; }
@@ -347,10 +345,9 @@ static struct drm_encoder * amdgpu_connector_best_single_encoder(struct drm_connector *connector) {struct drm_encoder *encoder; -int i;/* pick the first one */ -drm_connector_for_each_possible_encoder (connector, encoder, i) +drm_connector_for_each_possible_encoder (connector, encoder)return encoder;return NULL ;
@@ -1065,9 +1062,8 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)/* find analog encoder */ if (amdgpu_connector->dac_load_detect) {struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (encoder->encoder_type !=DRM_MODE_ENCODER_DAC && encoder->encoder_type !=DRM_MODE_ENCODER_TVDAC )continue ;
@@ -1117,9 +1113,8 @@ amdgpu_connector_dvi_encoder(struct drm_connector *connector) {struct amdgpu_connector *amdgpu_connector =to_amdgpu_connector (connector);struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (amdgpu_connector->use_digital == true) {if (encoder->encoder_type ==DRM_MODE_ENCODER_TMDS )return encoder;
@@ -1134,7 +1129,7 @@ amdgpu_connector_dvi_encoder(struct drm_connector *connector)/* then check use digitial */ /* pick the first one */ -drm_connector_for_each_possible_encoder (connector, encoder, i) +drm_connector_for_each_possible_encoder (connector, encoder)return encoder;return NULL ;
@@ -1271,9 +1266,8 @@ u16 amdgpu_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *conn {struct drm_encoder *encoder;struct amdgpu_encoder *amdgpu_encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) { amdgpu_encoder =to_amdgpu_encoder (encoder);switch (amdgpu_encoder->encoder_id) {
@@ -1292,10 +1286,9 @@ static bool amdgpu_connector_encoder_is_hbr2(struct drm_connector *connector) {struct drm_encoder *encoder;struct amdgpu_encoder *amdgpu_encoder; -int i;bool found = false; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) { amdgpu_encoder =to_amdgpu_encoder (encoder);if (amdgpu_encoder->caps &ATOM_ENCODER_CAP_RECORD_HBR2 ) found = true;
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +2 -3
@@ -260,15 +260,14 @@ static struct drm_encoder * dce_virtual_encoder(struct drm_connector *connector) {struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (encoder->encoder_type ==DRM_MODE_ENCODER_VIRTUAL )return encoder; }/* pick the first one */ -drm_connector_for_each_possible_encoder (connector, encoder, i) +drm_connector_for_each_possible_encoder (connector, encoder)return encoder;return NULL ;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -1
@@ -4836,7 +4836,13 @@ static int to_drm_connector_type(enum signal_type st)static struct drm_encoder *amdgpu_dm_connector_to_encoder (struct drm_connector *connector) { -return drm_encoder_find (connector->dev,NULL , connector->encoder_ids[0 ]); +struct drm_encoder *encoder; + +/* There is only one encoder per connector */ +drm_connector_for_each_possible_encoder (connector, encoder) +return encoder; + +return NULL ; }static void amdgpu_dm_get_native_mode (struct drm_connector *connector)
drivers/gpu/drm/drm_client_modeset.c +1 -2
@@ -415,9 +415,8 @@ static bool connector_has_possible_crtc(struct drm_connector *connector, struct drm_crtc *crtc) {struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (encoder->possible_crtcs &drm_crtc_mask (crtc))return true; }
drivers/gpu/drm/drm_connector.c +15 -25
@@ -365,8 +365,6 @@ EXPORT_SYMBOL(drm_connector_attach_edid_property);int drm_connector_attach_encoder (struct drm_connector *connector,struct drm_encoder *encoder) { -int i; -/* * In the past, drivers have attempted to model the static association * of connector to encoder in simple connector/encoder devices using a
@@ -381,18 +379,15 @@ int drm_connector_attach_encoder(struct drm_connector *connector,if (WARN_ON (connector->encoder))return -EINVAL ; -for (i =0 ; i <ARRAY_SIZE (connector->encoder_ids); i++) { -if (connector->encoder_ids[i] ==0 ) { - connector->encoder_ids[i] = encoder->base.id; -return 0 ; - } - } -return -ENOMEM ; + connector->possible_encoders |=drm_encoder_mask (encoder); + +return 0 ; }EXPORT_SYMBOL (drm_connector_attach_encoder);/** -* drm_connector_has_possible_encoder - check if the connector and encoder are assosicated with each other +* drm_connector_has_possible_encoder - check if the connector and encoder are +* associated with each other * @connector: the connector * @encoder: the encoder *
@@ -402,15 +397,7 @@ EXPORT_SYMBOL(drm_connector_attach_encoder);bool drm_connector_has_possible_encoder (struct drm_connector *connector,struct drm_encoder *encoder) { -struct drm_encoder *enc; -int i; - -drm_connector_for_each_possible_encoder (connector, enc, i) { -if (enc == encoder) -return true; - } - -return false; +return connector->possible_encoders &drm_encoder_mask (encoder); }EXPORT_SYMBOL (drm_connector_has_possible_encoder);
@@ -2121,7 +2108,6 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,int encoders_count =0 ;int ret =0 ;int copied =0 ; -int i;struct drm_mode_modeinfo u_mode;struct drm_mode_modeinfo __user *mode_ptr;uint32_t __user *encoder_ptr;
@@ -2136,14 +2122,13 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,if (!connector)return -ENOENT ; -drm_connector_for_each_possible_encoder (connector, encoder, i) - encoders_count++; + encoders_count =hweight32 (connector->possible_encoders);if ((out_resp->count_encoders >= encoders_count) && encoders_count) { copied =0 ; encoder_ptr = (uint32_t __user *)(unsigned long )(out_resp->encoders_ptr); -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (put_user (encoder->base.id, encoder_ptr + copied)) { ret = -EFAULT ; goto out;
@@ -2342,6 +2327,11 @@ EXPORT_SYMBOL(drm_mode_create_tile_group);struct drm_encoder *drm_connector_get_single_encoder (struct drm_connector *connector) { -WARN_ON (connector->encoder_ids[1 ]); -return drm_encoder_find (connector->dev,NULL , connector->encoder_ids[0 ]); +struct drm_encoder *encoder; + +WARN_ON (hweight32 (connector->possible_encoders) >1 ); +drm_connector_for_each_possible_encoder (connector, encoder) +return encoder; + +return NULL ; }
drivers/gpu/drm/drm_probe_helper.c +1 -2
@@ -93,7 +93,6 @@ drm_mode_validate_pipeline(struct drm_display_mode *mode,struct drm_device *dev = connector->dev;enum drm_mode_status ret =MODE_OK ;struct drm_encoder *encoder; -int i;/* Step 1: Validate against connector */ ret =drm_connector_mode_valid (connector, mode);
@@ -101,7 +100,7 @@ drm_mode_validate_pipeline(struct drm_display_mode *mode,return ret;/* Step 2: Validate against encoders and crtcs */ -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {struct drm_crtc *crtc; ret =drm_encoder_mode_valid (encoder, mode);
drivers/gpu/drm/nouveau/dispnv04/disp.c +1 -1
@@ -256,7 +256,7 @@ nv04_display_create(struct drm_device *dev)list_for_each_entry_safe (connector, ct, &dev->mode_config.connector_list, head) { -if (!connector->encoder_ids[0 ]) { +if (!connector->possible_encoders) {NV_WARN (drm,"%s has no encoders, removing\n" , connector->name); connector->funcs->destroy (connector);
drivers/gpu/drm/nouveau/dispnv50/disp.c +1 -1
@@ -2391,7 +2391,7 @@ nv50_display_create(struct drm_device *dev)/* cull any connectors we created that don't have an encoder */ list_for_each_entry_safe (connector, tmp, &dev->mode_config.connector_list, head) { -if (connector->encoder_ids[0 ]) +if (connector->possible_encoders)continue ; NV_WARN(drm, "%s has no encoders, removing\n",
drivers/gpu/drm/nouveau/nouveau_connector.c +3 -4
@@ -365,9 +365,8 @@ find_encoder(struct drm_connector *connector, int type) {struct nouveau_encoder *nv_encoder;struct drm_encoder *enc; -int i; -drm_connector_for_each_possible_encoder (connector, enc, i) { +drm_connector_for_each_possible_encoder (connector, enc) { nv_encoder =nouveau_encoder (enc); if (type == DCB_OUTPUT_ANY ||
@@ -414,10 +413,10 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)struct drm_device *dev = connector->dev;struct nouveau_encoder *nv_encoder =NULL , *found =NULL ;struct drm_encoder *encoder; -int i, ret; +int ret;bool switcheroo_ddc = false; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) { nv_encoder =nouveau_encoder (encoder);switch (nv_encoder->dcb->type) {
drivers/gpu/drm/radeon/radeon_connectors.c +9 -18
@@ -249,11 +249,10 @@ radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_cstruct drm_encoder *encoder;const struct drm_connector_helper_funcs *connector_funcs = connector->helper_private;bool connected; -int i; best_encoder = connector_funcs->best_encoder (connector); -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if ((encoder == best_encoder) && (status == connector_status_connected)) connected = true;else
@@ -269,9 +268,8 @@ radeon_connector_update_scratch_regs(struct drm_connector *connector, enum drm_cstatic struct drm_encoder *radeon_find_encoder (struct drm_connector *connector,int encoder_type) {struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (encoder->encoder_type == encoder_type)return encoder; }
@@ -380,10 +378,9 @@ static int radeon_ddc_get_modes(struct drm_connector *connector)static struct drm_encoder *radeon_best_single_encoder (struct drm_connector *connector) {struct drm_encoder *encoder; -int i;/* pick the first one */ -drm_connector_for_each_possible_encoder (connector, encoder, i) +drm_connector_for_each_possible_encoder (connector, encoder)return encoder;return NULL ;
@@ -428,14 +425,13 @@ radeon_connector_analog_encoder_conflict_solve(struct drm_connector *connector,list_for_each_entry (conflict, &dev->mode_config.connector_list, head) {struct drm_encoder *enc; -int i;if (conflict == connector)continue ; radeon_conflict =to_radeon_connector (conflict); -drm_connector_for_each_possible_encoder (conflict, enc, i) { +drm_connector_for_each_possible_encoder (conflict, enc) {/* if the IDs match */ if (enc == encoder) {if (conflict->status != connector_status_connected)
@@ -1363,9 +1359,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)/* find analog encoder */ if (radeon_connector->dac_load_detect) { -int i; - -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (encoder->encoder_type !=DRM_MODE_ENCODER_DAC && encoder->encoder_type !=DRM_MODE_ENCODER_TVDAC )continue ;
@@ -1443,9 +1437,8 @@ static struct drm_encoder *radeon_dvi_encoder(struct drm_connector *connector) {struct radeon_connector *radeon_connector =to_radeon_connector (connector);struct drm_encoder *encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) {if (radeon_connector->use_digital == true) {if (encoder->encoder_type ==DRM_MODE_ENCODER_TMDS )return encoder;
@@ -1460,7 +1453,7 @@ static struct drm_encoder *radeon_dvi_encoder(struct drm_connector *connector)/* then check use digitial */ /* pick the first one */ -drm_connector_for_each_possible_encoder (connector, encoder, i) +drm_connector_for_each_possible_encoder (connector, encoder)return encoder;return NULL ;
@@ -1603,9 +1596,8 @@ u16 radeon_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *conn {struct drm_encoder *encoder;struct radeon_encoder *radeon_encoder; -int i; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) { radeon_encoder =to_radeon_encoder (encoder);switch (radeon_encoder->encoder_id) {
@@ -1624,10 +1616,9 @@ static bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector) {struct drm_encoder *encoder;struct radeon_encoder *radeon_encoder; -int i;bool found = false; -drm_connector_for_each_possible_encoder (connector, encoder, i) { +drm_connector_for_each_possible_encoder (connector, encoder) { radeon_encoder =to_radeon_encoder (encoder);if (radeon_encoder->caps &ATOM_ENCODER_CAP_RECORD_HBR2 ) found = true;
include/drm/drm_connector.h +7 -11
@@ -1288,12 +1288,12 @@ struct drm_connector {/** @override_edid: has the EDID been overwritten through debugfs for testing? */ bool override_edid; -#define DRM_CONNECTOR_MAX_ENCODER 3/** -* @encoder_ids: Valid encoders for this connector. Please only use -* drm_connector_for_each_possible_encoder() to enumerate these. +* @possible_encoders: Bit mask of encoders that can drive this +* connector, drm_encoder_index() determines the index into the bitfield +* and the bits are set with drm_connector_attach_encoder(). */ -uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER ]; +u32 possible_encoders;/** * @encoder: Currently bound encoder driving this connector, if any.
@@ -1608,13 +1608,9 @@ bool drm_connector_has_possible_encoder(struct drm_connector *connector,* drm_connector_for_each_possible_encoder - iterate connector's possible encoders * @connector: &struct drm_connector pointer * @encoder: &struct drm_encoder pointer used as cursor -* @__i: int iteration cursor, for macro-internal use */ -#define drm_connector_for_each_possible_encoder (connector, encoder, __i) \ - for ((__i) = 0; (__i) < ARRAY_SIZE((connector)->encoder_ids) && \ - (connector)->encoder_ids[(__i)] != 0; (__i)++) \ - for_each_if((encoder) = \ - drm_encoder_find((connector)->dev, NULL, \ - (connector)->encoder_ids[(__i)])) \ +#define drm_connector_for_each_possible_encoder (connector, encoder) \ + drm_for_each_encoder_mask(encoder, (connector)->dev, \ + (connector)->possible_encoders)#endif
Signature · 6 lines
2.23.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 107 lines · José Roberto de Souza
This 3 non-atomic drivers all have the same function getting the only encoder available in the connector, also atomic drivers have this fallback. So moving it a common place and sharing between atomic and non-atomic drivers.
While at it I also removed the mention of
drm_atomic_helper_best_encoder()that was renamed in commit297e30b5d9b6("drm/atomic-helper: Unexportdrm_atomic_helper_best_encoder").Suggested-by Ville Syrjälä <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Daniel Vetter <[email protected]>Cc Laurent Pinchart <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/ast/ast_mode.c | 12 ------------ drivers/gpu/drm/drm_atomic_helper.c | 15 ++------------- drivers/gpu/drm/drm_connector.c | 11 +++++++++++ drivers/gpu/drm/drm_crtc_helper.c | 8 +++++++- drivers/gpu/drm/drm_crtc_internal.h | 2 ++ drivers/gpu/drm/mgag200/mgag200_mode.c | 11 ----------- drivers/gpu/drm/udl/udl_connector.c | 8 -------- include/drm/drm_modeset_helper_vtables.h | 6 +++--- 8 files changed, 25 insertions(+), 48 deletions(-)drivers/gpu/drm/ast/ast_mode.c +0
-12@@ -687,17 +687,6 @@ static void ast_encoder_destroy(struct drm_encoder *encoder)kfree (encoder); } - -static struct drm_encoder *ast_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} - -static const struct drm_encoder_funcs ast_enc_funcs = { .destroy = ast_encoder_destroy, };@@ -847,7 +836,6 @@ static void ast_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs ast_connector_helper_funcs = { .mode_valid = ast_mode_valid, .get_modes = ast_get_modes, - .best_encoder = ast_best_single_encoder, };static const struct drm_connector_funcs ast_connector_funcs = {drivers/gpu/drm/drm_atomic_helper.c +2
-13@@ -97,17 +97,6 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, } } -/* -* For connectors that support multiple encoders, either the -* .atomic_best_encoder() or .best_encoder() operation must be implemented. -*/ -static struct drm_encoder * -pick_single_encoder_for_connector (struct drm_connector *connector) -{ -WARN_ON (connector->encoder_ids[1 ]); -return drm_encoder_find (connector->dev,NULL , connector->encoder_ids[0 ]); -} -static int handle_conflicting_encoders (struct drm_atomic_state *state,bool disable_conflicting_encoders) {@@ -135,7 +124,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector);else - new_encoder =pick_single_encoder_for_connector (connector); + new_encoder =drm_connector_get_single_encoder (connector);if (new_encoder) {if (encoder_mask &drm_encoder_mask (new_encoder)) {@@ -359,7 +348,7 @@ update_connector_routing(struct drm_atomic_state *state,else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector);else - new_encoder =pick_single_encoder_for_connector (connector); + new_encoder =drm_connector_get_single_encoder (connector);if (!new_encoder) { DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",drivers/gpu/drm/drm_connector.c +1
-0@@ -2334,3 +2334,14 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,return tg; }EXPORT_SYMBOL (drm_mode_create_tile_group); +
drivers/gpu/drm/drm_connector.c struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, · line 2347
Quoted 10 lines
drivers/gpu/drm/drm_connector.c +10
-0+/* +* For connectors that support multiple encoders, either the +* .atomic_best_encoder() or .best_encoder() operation must be implemented. +*/ +struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector) +{ +WARN_ON (connector->encoder_ids[1 ]); +return drm_encoder_find (connector->dev,NULL , connector->encoder_ids[0 ]); +}
I believe we need EXPORT_SYMBOL.
Quoted 120 lines
drivers/gpu/drm/drm_crtc_helper.c +7
-1@@ -48,6 +48,8 @@#include <drm/drm_print.h> #include <drm/drm_vblank.h> +#include "drm_crtc_internal.h" +/** * DOC: overview * @@ -625,7 +627,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, new_encoder = connector->encoder;for (ro =0 ; ro < set->num_connectors; ro++) {if (set->connectors[ro] == connector) { - new_encoder = connector_funcs->best_encoder (connector); +if (connector_funcs->best_encoder) + new_encoder = connector_funcs->best_encoder (connector); +else + new_encoder =drm_connector_get_single_encoder (connector); +/* if we can't get an encoder for a connector we are setting now - then fail */ if (new_encoder ==NULL )drivers/gpu/drm/drm_crtc_internal.h +2
-0@@ -181,6 +181,8 @@ int drm_connector_set_obj_prop(struct drm_mode_object *obj,int drm_connector_create_standard_properties (struct drm_device *dev);const char *drm_get_connector_force_name (enum drm_connector_force force);void drm_connector_free_work_fn (struct work_struct *work); +struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector);/* IOCTL */ int drm_connector_property_set_ioctl(struct drm_device *dev,drivers/gpu/drm/mgag200/mgag200_mode.c +0
-11@@ -1638,16 +1638,6 @@ static enum drm_mode_status mga_vga_mode_valid(struct drm_connector *connector,return MODE_OK ; } -static struct drm_encoder *mga_connector_best_encoder (struct drm_connector - *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} -static void mga_connector_destroy (struct drm_connector *connector) {struct mga_connector *mga_connector =to_mga_connector (connector);@@ -1659,7 +1649,6 @@ static void mga_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs mga_vga_connector_helper_funcs = { .get_modes = mga_vga_get_modes, .mode_valid = mga_vga_mode_valid, - .best_encoder = mga_connector_best_encoder, };static const struct drm_connector_funcs mga_vga_connector_funcs = {drivers/gpu/drm/udl/udl_connector.c +0
-8@@ -90,13 +90,6 @@ udl_detect(struct drm_connector *connector, bool force)return connector_status_connected; } -static struct drm_encoder * -udl_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -return drm_encoder_find (connector->dev,NULL , enc_id); -} -static int udl_connector_set_property (struct drm_connector *connector,struct drm_property *property,uint64_t val)@@ -120,7 +113,6 @@ static void udl_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs udl_connector_helper_funcs = { .get_modes = udl_get_modes, .mode_valid = udl_mode_valid, - .best_encoder = udl_best_single_encoder, };static const struct drm_connector_funcs udl_connector_funcs = {include/drm/drm_modeset_helper_vtables.h +3
-3@@ -955,8 +955,8 @@ struct drm_connector_helper_funcs {* @atomic_best_encoder. * * You can leave this function to NULL if the connector is only -* attached to a single encoder and you are using the atomic helpers. -* In this case, the core will call drm_atomic_helper_best_encoder() +* attached to a single encoder. +* In this case, the core will call drm_connector_get_single_encoder() * for you. * * RETURNS: @@ -977,7 +977,7 @@ struct drm_connector_helper_funcs {* * This function is used by drm_atomic_helper_check_modeset(). * If it is not implemented, the core will fallback to @best_encoder -* (or drm_atomic_helper_best_encoder() if @best_encoder is NULL). +* (or drm_connector_get_single_encoder() if @best_encoder is NULL). * * NOTE: * Signature · 1 line
2.23.0
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 141 lines · Ville Syrjälä
Quoted 139 lines · José Roberto de Souza
This 3 non-atomic drivers all have the same function getting the only encoder available in the connector, also atomic drivers have this fallback. So moving it a common place and sharing between atomic
and non-atomic drivers.While at it I also removed the mention of
drm_atomic_helper_best_encoder()that was renamed in commit297e30b5d9b6("drm/atomic-helper: Unexportdrm_atomic_helper_best_encoder").Suggested-by Ville Syrjälä <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Daniel Vetter <[email protected]>Cc Laurent Pinchart <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/ast/ast_mode.c | 12 ------------ drivers/gpu/drm/drm_atomic_helper.c | 15 ++------------- drivers/gpu/drm/drm_connector.c | 11 +++++++++++ drivers/gpu/drm/drm_crtc_helper.c | 8 +++++++- drivers/gpu/drm/drm_crtc_internal.h | 2 ++ drivers/gpu/drm/mgag200/mgag200_mode.c | 11 ----------- drivers/gpu/drm/udl/udl_connector.c | 8 -------- include/drm/drm_modeset_helper_vtables.h | 6 +++--- 8 files changed, 25 insertions(+), 48 deletions(-)drivers/gpu/drm/ast/ast_mode.c +0
-11@@ -687,17 +687,6 @@ static void ast_encoder_destroy(struct drm_encoder *encoder)kfree (encoder ); } - -static struct drm_encoder *ast_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} - -static const struct drm_encoder_funcs ast_enc_funcs = {drivers/gpu/drm/ast/ast_mode.c +0
-1.destroy = ast_encoder_destroy, };@@ -847,7 +836,6 @@ static void ast_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs ast_connector_helper_funcs = { .mode_valid = ast_mode_valid, .get_modes = ast_get_modes, - .best_encoder = ast_best_single_encoder, };static const struct
drm_connector_funcsast_connector_funcs= {drivers/gpu/drm/drm_atomic_helper.c +0
-3@@ -97,17 +97,6 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, } } -/* -* For connectors that support multiple encoders, either the -* .atomic_best_encoder() or .best_encoder() operation must be implemented.
- */drivers/gpu/drm/drm_atomic_helper.c +0
-5-static struct drm_encoder * -pick_single_encoder_for_connector (struct drm_connector *connector) -{ -WARN_ON (connector->encoder_ids[1 ]); - return drm_encoder_find(connector->dev, NULL, connector-Quoted 1 line
encoder_ids[0]);
drivers/gpu/drm/drm_atomic_helper.c +0
-2-} - static int handle_conflicting_encoders(struct drm_atomic_state*state,
booldisable_conflicting_encoders)
{drivers/gpu/drm/drm_atomic_helper.c +1
-1@@ -135,7 +124,7 @@ static int handle_conflicting_encoders(structdrm_atomic_state *state, else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector); else - new_encoder =pick_single_encoder_for_connector (connector ); + new_encoder =drm_connector_get_single_encoder (connector);drivers/gpu/drm/drm_atomic_helper.c +0
-0if (new_encoder) { if (encoder_mask &
drm_encoder_mask(new_encoder)) {drivers/gpu/drm/drm_atomic_helper.c +1
-1@@ -359,7 +348,7 @@ update_connector_routing(structdrm_atomic_state *state, else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector); else - new_encoder =pick_single_encoder_for_connector (connector ); + new_encoder =drm_connector_get_single_encoder (connector);drivers/gpu/drm/drm_atomic_helper.c +0
-0if (!new_encoder) { DRM_DEBUG_ATOMIC("No suitable encoder found for[CONNECTOR:%d:%s]\n",
drivers/gpu/drm/drm_connector.c +4
-0@@ -2334,3 +2334,14 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, return tg; } EXPORT_SYMBOL(drm_mode_create_tile_group); + +/* +* For connectors that support multiple encoders, either the +* .atomic_best_encoder() or .best_encoder() operation must be implemented.
+ */drivers/gpu/drm/drm_connector.c +5
-0+struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector) +{ +WARN_ON (connector->encoder_ids[1 ]); + return drm_encoder_find(connector->dev, NULL, connector-
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
encoder_ids[0]);
+}
I believe we need
EXPORT_SYMBOL.
I don't think we should allow drivers to call this function.
Quoted 142 lines
Quoted 142 lines
drivers/gpu/drm/drm_crtc_helper.c +6
-1@@ -48,6 +48,8 @@#include <drm/drm_print.h> #include <drm/drm_vblank.h> +#include "drm_crtc_internal.h" +/** * DOC: overview * @@ -625,7 +627,11 @@ int drm_crtc_helper_set_config(structdrm_mode_set *set, new_encoder = connector->encoder;for (ro =0 ; ro < set->num_connectors; ro++) {if (set->connectors[ro] == connector) { - new_encoder = connector_funcs- >best_encoder(connector); +if (connector_funcs->best_encoder) + new_encoder = connector_funcs- >best_encoder(connector); +else + new_encoder =
drm_connector_get_single_encoder(connector);drivers/gpu/drm/drm_crtc_helper.c +1
-0+/* if we can't get an encoder for a connector
drivers/gpu/drm/drm_crtc_helper.c +0
-0we are setting now - then fail */ if (new_encoder ==NULL )drivers/gpu/drm/drm_crtc_internal.h +2
-0@@ -181,6 +181,8 @@ int drm_connector_set_obj_prop(structdrm_mode_object *obj, int drm_connector_create_standard_properties(struct drm_device *dev);const char *drm_get_connector_force_name (enum drm_connector_force force);void drm_connector_free_work_fn (struct work_struct *work); +struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector);/* IOCTL */
int drm_connector_property_set_ioctl(structdrm_device*dev,drivers/gpu/drm/mgag200/mgag200_mode.c +0
-1@@ -1638,16 +1638,6 @@ static enum drm_mode_status mga_vga_mode_valid(struct drm_connector *connector, return MODE_OK; } -static struct drm_encoder *mga_connector_best_encoder(struct
drm_connectordrivers/gpu/drm/mgag200/mgag200_mode.c +0
-9- *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} -static void mga_connector_destroy (struct drm_connector *connector) { struct mga_connector *mga_connector =
to_mga_connector(connector);drivers/gpu/drm/mgag200/mgag200_mode.c +0
-1@@ -1659,7 +1649,6 @@ static void mga_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs mga_vga_connector_helper_funcs = { .get_modes = mga_vga_get_modes, .mode_valid = mga_vga_mode_valid, - .best_encoder = mga_connector_best_encoder, };static const struct
drm_connector_funcsmga_vga_connector_funcs=
{drivers/gpu/drm/udl/udl_connector.c +0
-7@@ -90,13 +90,6 @@ udl_detect(struct drm_connector *connector, bool force)return connector_status_connected; } -static struct drm_encoder * -udl_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -return drm_encoder_find (connector->dev,NULL , enc_id); -} - static int udl_connector_set_property(struct drm_connector *connector,drivers/gpu/drm/udl/udl_connector.c +0
-1struct drm_property *property, uint64_t val)@@ -120,7 +113,6 @@ static void udl_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs udl_connector_helper_funcs = { .get_modes = udl_get_modes, .mode_valid = udl_mode_valid, - .best_encoder = udl_best_single_encoder, };static const struct
drm_connector_funcsudl_connector_funcs= {include/drm/drm_modeset_helper_vtables.h +0
-1@@ -955,8 +955,8 @@ struct drm_connector_helper_funcs {* @atomic_best_encoder. * * You can leave this function to NULL if the connector is only -* attached to a single encoder and you are using the atomic helpers.
include/drm/drm_modeset_helper_vtables.h +0
-1-* In this case, the core will call
drm_atomic_helper_best_encoder()include/drm/drm_modeset_helper_vtables.h +2
-0+* attached to a single encoder. +* In this case, the core will call
drm_connector_get_single_encoder()include/drm/drm_modeset_helper_vtables.h +0
-0* for you. * * RETURNS: @@ -977,7 +977,7 @@ struct drm_connector_helper_funcs {* * This function is used by drm_atomic_helper_check_modeset(). * If it is not implemented, the core will fallback to @best_encoder
include/drm/drm_modeset_helper_vtables.h +0
-1-* (or drm_atomic_helper_best_encoder() if @best_encoder is
Quoted 8 lines
Quoted 8 lines
NULL).
include/drm/drm_modeset_helper_vtables.h +1
-0+* (or drm_connector_get_single_encoder() if @best_encoder is NULL).
include/drm/drm_modeset_helper_vtables.h +0
-0* * NOTE: * Signature · 1 line
2.23.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 142 lines · Jose
Quoted 141 lines · Ville Syrjälä
Quoted 139 lines · José Roberto de Souza
This 3 non-atomic drivers all have the same function getting the only encoder available in the connector, also atomic drivers have this fallback. So moving it a common place and sharing between atomic
and non-atomic drivers.While at it I also removed the mention of
drm_atomic_helper_best_encoder()that was renamed in commit297e30b5d9b6("drm/atomic-helper: Unexportdrm_atomic_helper_best_encoder").Suggested-by Ville Syrjälä <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Daniel Vetter <[email protected]>Cc Laurent Pinchart <[email protected]>Signed-off-by José Roberto de Souza <[email protected]>--- drivers/gpu/drm/ast/ast_mode.c | 12 ------------ drivers/gpu/drm/drm_atomic_helper.c | 15 ++------------- drivers/gpu/drm/drm_connector.c | 11 +++++++++++ drivers/gpu/drm/drm_crtc_helper.c | 8 +++++++- drivers/gpu/drm/drm_crtc_internal.h | 2 ++ drivers/gpu/drm/mgag200/mgag200_mode.c | 11 ----------- drivers/gpu/drm/udl/udl_connector.c | 8 -------- include/drm/drm_modeset_helper_vtables.h | 6 +++--- 8 files changed, 25 insertions(+), 48 deletions(-)drivers/gpu/drm/ast/ast_mode.c +0
-11@@ -687,17 +687,6 @@ static void ast_encoder_destroy(struct drm_encoder *encoder)kfree (encoder ); } - -static struct drm_encoder *ast_best_single_encoder (struct drm_connector *connector) -{ -int enc_id = connector->encoder_ids[0 ]; -/* pick the encoder ids */ -if (enc_id) -return drm_encoder_find (connector->dev,NULL , enc_id); -return NULL ; -} - -static const struct drm_encoder_funcs ast_enc_funcs = {drivers/gpu/drm/ast/ast_mode.c +0
-1.destroy = ast_encoder_destroy, };@@ -847,7 +836,6 @@ static void ast_connector_destroy(struct drm_connector *connector)static const struct drm_connector_helper_funcs ast_connector_helper_funcs = { .mode_valid = ast_mode_valid, .get_modes = ast_get_modes, - .best_encoder = ast_best_single_encoder, };static const struct
drm_connector_funcsast_connector_funcs= {drivers/gpu/drm/drm_atomic_helper.c +0
-3@@ -97,17 +97,6 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, } } -/* -* For connectors that support multiple encoders, either the -* .atomic_best_encoder() or .best_encoder() operation must be implemented.
- */drivers/gpu/drm/drm_atomic_helper.c +0
-5-static struct drm_encoder * -pick_single_encoder_for_connector (struct drm_connector *connector) -{ -WARN_ON (connector->encoder_ids[1 ]); - return drm_encoder_find(connector->dev, NULL, connector-Quoted 1 line
encoder_ids[0]);
drivers/gpu/drm/drm_atomic_helper.c +0
-2-} - static int handle_conflicting_encoders(struct drm_atomic_state*state,
booldisable_conflicting_encoders)
{drivers/gpu/drm/drm_atomic_helper.c +1
-1@@ -135,7 +124,7 @@ static int handle_conflicting_encoders(structdrm_atomic_state *state, else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector); else - new_encoder =pick_single_encoder_for_connector (connector ); + new_encoder =drm_connector_get_single_encoder (connector);drivers/gpu/drm/drm_atomic_helper.c +0
-0if (new_encoder) { if (encoder_mask &
drm_encoder_mask(new_encoder)) {drivers/gpu/drm/drm_atomic_helper.c +1
-1@@ -359,7 +348,7 @@ update_connector_routing(structdrm_atomic_state *state, else if (funcs->best_encoder) new_encoder = funcs->best_encoder (connector); else - new_encoder =pick_single_encoder_for_connector (connector ); + new_encoder =drm_connector_get_single_encoder (connector);drivers/gpu/drm/drm_atomic_helper.c +0
-0if (!new_encoder) { DRM_DEBUG_ATOMIC("No suitable encoder found for[CONNECTOR:%d:%s]\n",
drivers/gpu/drm/drm_connector.c +4
-0@@ -2334,3 +2334,14 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, return tg; } EXPORT_SYMBOL(drm_mode_create_tile_group); + +/* +* For connectors that support multiple encoders, either the +* .atomic_best_encoder() or .best_encoder() operation must be implemented.
+ */drivers/gpu/drm/drm_connector.c +5
-0+struct drm_encoder * +drm_connector_get_single_encoder (struct drm_connector *connector) +{ +WARN_ON (connector->encoder_ids[1 ]); + return drm_encoder_find(connector->dev, NULL, connector-
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
encoder_ids[0]);
+}
I believe we need
EXPORT_SYMBOL.I don't think we should allow drivers to call this function.
Not drivers. But you already call it from the other module. In fact all your calls seem to be from the other module, so perhaps you should move the function into that module.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/connector: Share with non-atomic drivers the function to get the single encoder
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/connector: Share with non-atomic drivers the function to get the single encoder
URL : https://patchwork.freedesktop.org/series/66547/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip bbd3d29d2b47 drm/connector: Share with non-atomic drivers the function to get the single encoder cb40462fdc86 drm/connector: Allow max possible encoders to attach to a connector -:491: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'connector' - possible side-effects? #491: FILE: include/drm/drm_connector.h:1612: +#define drm_connector_for_each_possible_encoder(connector, encoder) \ + drm_for_each_encoder_mask(encoder, (connector)->dev, \ + (connector)->possible_encoders)
total: 0 errors, 0 warnings, 1 checks, 388 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/2] drm/connector: Share with non-atomic drivers the function to get the single encoder
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/connector: Share with non-atomic drivers the function to get the single encoder
URL : https://patchwork.freedesktop.org/series/66547/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6874 -> Patchwork_14365
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/
Known issues
------------
Here are the changes found in Patchwork_14365 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_mmap_gtt@basic-small-bo-tiledx:
- fi-icl-u3: [PASS][1] -> [DMESG-WARN][2] ([fdo#107724]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/fi-icl-u3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/fi-icl-u3/igt@[email protected]
#### Possible fixes ####
* igt@gem_ctx_switch@legacy-render:
- fi-bxt-dsi: [INCOMPLETE][3] ([fdo#103927] / [fdo#111381]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/fi-bxt-dsi/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/fi-bxt-dsi/igt@[email protected]
* igt@gem_exec_suspend@basic-s4-devices:
- fi-kbl-7500u: [DMESG-WARN][5] ([fdo#105128] / [fdo#107139]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/fi-kbl-7500u/igt@[email protected]
* igt@gem_mmap_gtt@basic-short:
- fi-icl-u3: [DMESG-WARN][7] ([fdo#107724]) -> [PASS][8] +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/fi-icl-u3/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/fi-icl-u3/igt@[email protected]
* igt@i915_selftest@live_execlists:
- fi-skl-gvtdvm: [DMESG-FAIL][9] ([fdo#111108]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
* igt@i915_selftest@live_gem_contexts:
- fi-cfl-guc: [INCOMPLETE][11] ([fdo#111514]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/fi-cfl-guc/igt@i915_selftest@live_gem_contexts.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/fi-cfl-guc/igt@i915_selftest@live_gem_contexts.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105128]: https://bugs.freedesktop.org/show_bug.cgi?id=105128
[fdo#107139]: https://bugs.freedesktop.org/show_bug.cgi?id=107139
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108
[fdo#111381]: https://bugs.freedesktop.org/show_bug.cgi?id=111381
[fdo#111514]: https://bugs.freedesktop.org/show_bug.cgi?id=111514
Participating hosts (54 -> 47)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6874 -> Patchwork_14365
CI-20190529: 20190529
CI_DRM_6874: f9ee689ff55489da8db3cd5ddad533967c07561f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5178: efb4539494d94f03374874d3b61bd04ef3802aaa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14365: cb40462fdc864dcd4a7a0461a32dad8a9a4924fa @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
cb40462fdc86 drm/connector: Allow max possible encoders to attach to a connector bbd3d29d2b47 drm/connector: Share with non-atomic drivers the function to get the single encoder
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/2] drm/connector: Share with non-atomic drivers the function to get the single encoder
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/connector: Share with non-atomic drivers the function to get the single encoder
URL : https://patchwork.freedesktop.org/series/66547/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6874_full -> Patchwork_14365_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_14365_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_eio@reset-stress:
- shard-kbl: [PASS][1] -> [FAIL][2] ([fdo#109661])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-kbl6/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-kbl2/igt@[email protected]
* igt@gem_exec_balancer@smoke:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#110854])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb4/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb6/igt@[email protected]
* igt@gem_exec_blt@cold-max:
- shard-apl: [PASS][5] -> [INCOMPLETE][6] ([fdo#103927]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-apl6/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-apl6/igt@[email protected]
* igt@gem_exec_schedule@independent-bsd2:
- shard-iclb: [PASS][7] -> [SKIP][8] ([fdo#109276]) +20 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb3/igt@[email protected]
* igt@gem_exec_schedule@reorder-wide-bsd:
- shard-iclb: [PASS][9] -> [SKIP][10] ([fdo#111325]) +3 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb2/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-suspend:
- shard-skl: [PASS][11] -> [INCOMPLETE][12] ([fdo#110741])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-skl10/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-skl8/igt@[email protected]
* igt@kms_draw_crc@draw-method-rgb565-render-ytiled:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103184] / [fdo#103232])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb8/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb8/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: [PASS][15] -> [FAIL][16] ([fdo#105363])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-skl10/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-skl10/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-stridechange:
- shard-iclb: [PASS][17] -> [FAIL][18] ([fdo#103167])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-apl: [PASS][19] -> [DMESG-WARN][20] ([fdo#108566]) +3 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-apl6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-apl8/igt@[email protected]
* igt@kms_psr@psr2_cursor_mmap_gtt:
- shard-iclb: [PASS][21] -> [SKIP][22] ([fdo#109441])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_gtt.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb3/igt@kms_psr@psr2_cursor_mmap_gtt.html
* igt@perf@polling:
- shard-skl: [PASS][23] -> [FAIL][24] ([fdo#110728])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-skl6/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-skl2/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_async@concurrent-writes-bsd:
- shard-iclb: [SKIP][25] ([fdo#111325]) -> [PASS][26] +7 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb2/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb6/igt@[email protected]
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk: [FAIL][27] ([fdo#104873]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-glk1/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-glk5/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-atomic:
- shard-hsw: [FAIL][29] ([fdo#103355]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-hsw6/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-hsw4/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu:
- shard-iclb: [FAIL][31] ([fdo#103167]) -> [PASS][32] +2 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-apl: [DMESG-WARN][33] ([fdo#108566]) -> [PASS][34] +4 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-apl4/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-apl1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [FAIL][35] ([fdo#108145] / [fdo#110403]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-skl5/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-skl1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [FAIL][37] ([fdo#108145]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-skl7/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-skl6/igt@[email protected]
* igt@prime_busy@wait-hang-blt:
- shard-hsw: [INCOMPLETE][39] ([fdo#103540]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-hsw4/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-hsw5/igt@[email protected]
* igt@prime_vgem@fence-wait-bsd2:
- shard-iclb: [SKIP][41] ([fdo#109276]) -> [PASS][42] +18 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb6/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb2/igt@[email protected]
#### Warnings ####
* igt@gem_ctx_isolation@vcs1-nonpriv:
- shard-iclb: [SKIP][43] ([fdo#109276]) -> [FAIL][44] ([fdo#111329])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb8/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb2/igt@[email protected]
* igt@gem_mocs_settings@mocs-reset-bsd2:
- shard-iclb: [FAIL][45] ([fdo#111330]) -> [SKIP][46] ([fdo#109276]) +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb4/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb6/igt@[email protected]
* igt@gem_mocs_settings@mocs-settings-bsd2:
- shard-iclb: [SKIP][47] ([fdo#109276]) -> [FAIL][48] ([fdo#111330]) +1 similar issue
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-iclb8/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-iclb2/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-rte:
- shard-hsw: [FAIL][49] ([fdo#108040]) -> [INCOMPLETE][50] ([fdo#103540])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6874/shard-hsw2/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/shard-hsw2/igt@[email protected]
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
[fdo#110741]: https://bugs.freedesktop.org/show_bug.cgi?id=110741
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
[fdo#111329]: https://bugs.freedesktop.org/show_bug.cgi?id=111329
[fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6874 -> Patchwork_14365
CI-20190529: 20190529
CI_DRM_6874: f9ee689ff55489da8db3cd5ddad533967c07561f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5178: efb4539494d94f03374874d3b61bd04ef3802aaa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14365: cb40462fdc864dcd4a7a0461a32dad8a9a4924fa @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14365/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
kbuild test robot
build botThank you for the patch! Yet something to improve:
Hi "José,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc8 next-20190904]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jos-Roberto-de-Souza/drm-connector-Share-with-non-atomic-drivers-the-function-to-get-the-single-encoder/20190912-213415
config: x86_64-randconfig-g003-201936 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 If you fix the issue, kindly add following tag
All errors (new ones prefixed by >>):
>> ERROR: "drm_connector_get_single_encoder" [drivers/gpu/drm/drm_kms_helper.ko] undefined!
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel