drm_mode_object_find -> helpers
Subsystems (11)
cover drm_mode_object_find -> helpers
Slightly overdue, but retrofit recently added helpers to drivers. Note that there are a couple places left in core, but they get replaced in the atomic series and I didn't feel like making extra conflicts for myself.
Rob Clark (10):
drm/ast: use helpers
drm/bochs: use helpers
drm/cirrus: use helpers
drm/exynos: use helpers
drm/mgag200: use helpers
drm/udl: use helpers
drm/vmwgfx: use helpers
drm/nouveau: use helpers
drm/i915: use helpers
drm/radeon: use helpers
drivers/gpu/drm/ast/ast_mode.c | 12 +---- drivers/gpu/drm/bochs/bochs_kms.c | 13 +----- drivers/gpu/drm/cirrus/cirrus_mode.c | 14 +----- drivers/gpu/drm/exynos/exynos_drm_connector.c | 15 +----- drivers/gpu/drm/i915/intel_display.c | 9 ++-- drivers/gpu/drm/i915/intel_overlay.c | 9 ++-- drivers/gpu/drm/i915/intel_sprite.c | 12 ++--- drivers/gpu/drm/mgag200/mgag200_mode.c | 14 +----- drivers/gpu/drm/nouveau/nouveau_connector.c | 16 +++---- drivers/gpu/drm/radeon/r100.c | 6 +-- drivers/gpu/drm/radeon/r600_cs.c | 6 +-- drivers/gpu/drm/radeon/radeon_connectors.c | 66 ++++++++------------------- drivers/gpu/drm/udl/udl_connector.c | 9 +--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 +-- 14 files changed, 54 insertions(+), 153 deletions(-)
Signature · 1 line
1.9.3
PATCH 1/10 drm/ast: use helpers
--- drivers/gpu/drm/ast/ast_mode.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +2 -10
@@ -667,17 +667,9 @@ static void ast_encoder_destroy(struct drm_encoder *encoder)static struct drm_encoder *ast_best_single_encoder (struct drm_connector *connector) {int enc_id = connector->encoder_ids[0 ]; -struct drm_mode_object *obj; -struct drm_encoder *encoder; -/* pick the encoder ids */ -if (enc_id) { - obj =drm_mode_object_find (connector->dev, enc_id,DRM_MODE_OBJECT_ENCODER ); -if (!obj) -return NULL ; - encoder =obj_to_encoder (obj); -return encoder; - } +if (enc_id) +return drm_encoder_find (connector->dev, enc_id);return NULL ; }
Signature · 1 line
1.9.3
PATCH 2/10 drm/bochs: use helpers
In reply to Rob Clark--- drivers/gpu/drm/bochs/bochs_kms.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/gpu/drm/bochs/bochs_kms.c +2 -11
@@ -216,18 +216,9 @@ static struct drm_encoder * bochs_connector_best_encoder(struct drm_connector *connector) {int enc_id = connector->encoder_ids[0 ]; -struct drm_mode_object *obj; -struct drm_encoder *encoder; -/* pick the encoder ids */ -if (enc_id) { - obj =drm_mode_object_find (connector->dev, enc_id, -DRM_MODE_OBJECT_ENCODER ); -if (!obj) -return NULL ; - encoder =obj_to_encoder (obj); -return encoder; - } +if (enc_id) +return drm_encoder_find (connector->dev, enc_id);return NULL ; }
Signature · 1 line
1.9.3
PATCH 3/10 drm/cirrus: use helpers
In reply to Rob Clark--- drivers/gpu/drm/cirrus/cirrus_mode.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/cirrus/cirrus_mode.c +2 -12
@@ -509,19 +509,9 @@ static struct drm_encoder *cirrus_connector_best_encoder(struct drm_connector *connector) {int enc_id = connector->encoder_ids[0 ]; -struct drm_mode_object *obj; -struct drm_encoder *encoder; -/* pick the encoder ids */ -if (enc_id) { - obj = -drm_mode_object_find (connector->dev, enc_id, -DRM_MODE_OBJECT_ENCODER ); -if (!obj) -return NULL ; - encoder =obj_to_encoder (obj); -return encoder; - } +if (enc_id) +return drm_encoder_find (connector->dev, enc_id);return NULL ; }
Signature · 1 line
1.9.3
PATCH 4/10 drm/exynos: use helpers
In reply to Rob Clark--- drivers/gpu/drm/exynos/exynos_drm_connector.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_connector.c +1 -14
@@ -117,20 +117,7 @@ static struct drm_encoder *exynos_drm_best_encoder(struct drm_device *dev = connector->dev;struct exynos_drm_connector *exynos_connector =to_exynos_connector (connector); -struct drm_mode_object *obj; -struct drm_encoder *encoder; - - obj =drm_mode_object_find (dev, exynos_connector->encoder_id, -DRM_MODE_OBJECT_ENCODER ); -if (!obj) { -DRM_DEBUG_KMS ("Unknown ENCODER ID %d\n" , - exynos_connector->encoder_id); -return NULL ; - } - - encoder =obj_to_encoder (obj); - -return encoder; +return drm_encoder_find (dev, exynos_connector->encoder_id); }static struct drm_connector_helper_funcs exynos_connector_helper_funcs = {
Signature · 1 line
1.9.3
PATCH 5/10 drm/mgag200: use helpers
In reply to Rob Clark--- drivers/gpu/drm/mgag200/mgag200_mode.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +2 -12
@@ -1562,19 +1562,9 @@ static struct drm_encoder *mga_connector_best_encoder(struct drm_connector *connector) {int enc_id = connector->encoder_ids[0 ]; -struct drm_mode_object *obj; -struct drm_encoder *encoder; -/* pick the encoder ids */ -if (enc_id) { - obj = -drm_mode_object_find (connector->dev, enc_id, -DRM_MODE_OBJECT_ENCODER ); -if (!obj) -return NULL ; - encoder =obj_to_encoder (obj); -return encoder; - } +if (enc_id) +return drm_encoder_find (connector->dev, enc_id);return NULL ; }
Signature · 1 line
1.9.3
PATCH 6/10 drm/udl: use helpers
In reply to Rob Clark--- drivers/gpu/drm/udl/udl_connector.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/udl/udl_connector.c +1 -8
@@ -105,14 +105,7 @@ static struct drm_encoder* udl_best_single_encoder(struct drm_connector *connector) {int enc_id = connector->encoder_ids[0 ]; -struct drm_mode_object *obj; -struct drm_encoder *encoder; - - obj =drm_mode_object_find (connector->dev, enc_id,DRM_MODE_OBJECT_ENCODER ); -if (!obj) -return NULL ; - encoder =obj_to_encoder (obj); -return encoder; +return drm_encoder_find (connector->dev, enc_id); } static int udl_connector_set_property(struct drm_connector *connector,
Signature · 1 line
1.9.3
PATCH 7/10 drm/vmwgfx: use helpers
In reply to Rob Clark--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -4
@@ -1501,7 +1501,6 @@ int vmw_kms_cursor_bypass_ioctl(struct drm_device *dev, void *data, {struct drm_vmw_cursor_bypass_arg *arg = data;struct vmw_display_unit *du; -struct drm_mode_object *obj;struct drm_crtc *crtc;int ret =0 ;
@@ -1519,13 +1518,12 @@ int vmw_kms_cursor_bypass_ioctl(struct drm_device *dev, void *data,return 0 ; } - obj =drm_mode_object_find (dev, arg->crtc_id,DRM_MODE_OBJECT_CRTC ); -if (!obj) { + crtc =drm_crtc_find (dev, arg->crtc_id); +if (!crtc) { ret = -ENOENT ; goto out; } - crtc =obj_to_crtc (obj); du =vmw_crtc_to_du (crtc); du->hotspot_x = arg->xhot;
Signature · 1 line
1.9.3
PATCH 8/10 drm/nouveau: use helpers
In reply to Rob Clark--- drivers/gpu/drm/nouveau/nouveau_connector.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +8 -8
@@ -63,7 +63,7 @@ find_encoder(struct drm_connector *connector, int type) {struct drm_device *dev = connector->dev;struct nouveau_encoder *nv_encoder; -struct drm_mode_object *obj; +struct drm_encoder *enc;int i, id;for (i =0 ; i <DRM_CONNECTOR_MAX_ENCODER ; i++) {
@@ -71,10 +71,10 @@ find_encoder(struct drm_connector *connector, int type)if (!id)break ; - obj =drm_mode_object_find (dev, id,DRM_MODE_OBJECT_ENCODER ); -if (!obj) + enc =drm_encoder_find (dev, id); +if (!enc)continue ; - nv_encoder =nouveau_encoder (obj_to_encoder (obj)); + nv_encoder =nouveau_encoder (enc);if (type ==DCB_OUTPUT_ANY || (nv_encoder->dcb && nv_encoder->dcb->type == type))
@@ -119,7 +119,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)struct nouveau_drm *drm =nouveau_drm (dev);struct nouveau_gpio *gpio =nouveau_gpio (drm->device);struct nouveau_encoder *nv_encoder; -struct drm_mode_object *obj; +struct drm_encoder *encoder;int i, panel = -ENODEV ;/* eDP panels need powering on by us (if the VBIOS doesn't default it
@@ -139,10 +139,10 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)if (id ==0 )break ; - obj =drm_mode_object_find (dev, id,DRM_MODE_OBJECT_ENCODER ); -if (!obj) + encoder =drm_encoder_find (dev, id); +if (!encoder)continue ; - nv_encoder =nouveau_encoder (obj_to_encoder (obj)); + nv_encoder =nouveau_encoder (encoder);if (nv_encoder->dcb->type ==DCB_OUTPUT_DP ) {int ret =nouveau_dp_detect (nv_encoder);
Signature · 1 line
1.9.3
PATCH 9/10 drm/i915: use helpers
In reply to Rob Clark--- drivers/gpu/drm/i915/intel_display.c | 9 ++++----- drivers/gpu/drm/i915/intel_overlay.c | 9 ++++----- drivers/gpu/drm/i915/intel_sprite.c | 12 ++++-------- 3 files changed, 12 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -5
@@ -11738,21 +11738,20 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, struct drm_file *file) {struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data; -struct drm_mode_object *drmmode_obj; +struct drm_crtc *drmmode_crtc;struct intel_crtc *crtc;if (!drm_core_check_feature (dev,DRIVER_MODESET ))return -ENODEV ; - drmmode_obj =drm_mode_object_find (dev, pipe_from_crtc_id->crtc_id, -DRM_MODE_OBJECT_CRTC ); + drmmode_crtc =drm_crtc_find (dev, pipe_from_crtc_id->crtc_id); -if (!drmmode_obj) { +if (!drmmode_crtc) {DRM_ERROR ("no such CRTC id\n" );return -ENOENT ; } - crtc =to_intel_crtc (obj_to_crtc (drmmode_obj)); + crtc =to_intel_crtc (drmmode_crtc); pipe_from_crtc_id->pipe = crtc->pipe;return 0 ;
drivers/gpu/drm/i915/intel_overlay.c +4 -5
@@ -1039,7 +1039,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,struct drm_intel_overlay_put_image *put_image_rec = data;struct drm_i915_private *dev_priv = dev->dev_private;struct intel_overlay *overlay; -struct drm_mode_object *drmmode_obj; +struct drm_crtc *drmmode_crtc;struct intel_crtc *crtc;struct drm_i915_gem_object *new_bo;struct put_image_params *params;
@@ -1068,13 +1068,12 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,if (!params)return -ENOMEM ; - drmmode_obj =drm_mode_object_find (dev, put_image_rec->crtc_id, -DRM_MODE_OBJECT_CRTC ); -if (!drmmode_obj) { + drmmode_crtc =drm_crtc_find (dev, put_image_rec->crtc_id); +if (!drmmode_crtc) { ret = -ENOENT ; goto out_free; } - crtc =to_intel_crtc (obj_to_crtc (drmmode_obj)); + crtc =to_intel_crtc (drmmode_crtc); new_bo =to_intel_bo (drm_gem_object_lookup (dev, file_priv, put_image_rec->bo_handle));
drivers/gpu/drm/i915/intel_sprite.c +4 -8
@@ -1123,7 +1123,6 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data, struct drm_file *file_priv) {struct drm_intel_sprite_colorkey *set = data; -struct drm_mode_object *obj;struct drm_plane *plane;struct intel_plane *intel_plane;int ret =0 ;
@@ -1137,13 +1136,12 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,drm_modeset_lock_all (dev); - obj =drm_mode_object_find (dev, set->plane_id,DRM_MODE_OBJECT_PLANE ); -if (!obj) { + plane =drm_plane_find (dev, set->plane_id); +if (!plane) { ret = -ENOENT ; goto out_unlock; } - plane =obj_to_plane (obj); intel_plane =to_intel_plane (plane); ret = intel_plane->update_colorkey (plane, set);
@@ -1156,7 +1154,6 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data, struct drm_file *file_priv) {struct drm_intel_sprite_colorkey *get = data; -struct drm_mode_object *obj;struct drm_plane *plane;struct intel_plane *intel_plane;int ret =0 ;
@@ -1166,13 +1163,12 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,drm_modeset_lock_all (dev); - obj =drm_mode_object_find (dev, get->plane_id,DRM_MODE_OBJECT_PLANE ); -if (!obj) { + plane =drm_plane_find (dev, get->plane_id); +if (!plane) { ret = -ENOENT ; goto out_unlock; } - plane =obj_to_plane (obj); intel_plane =to_intel_plane (plane); intel_plane->get_colorkey (plane, get);
Signature · 1 line
1.9.3
PATCH 10/10 drm/radeon: use helpers
In reply to Rob Clark--- drivers/gpu/drm/radeon/r100.c | 6 +-- drivers/gpu/drm/radeon/r600_cs.c | 6 +-- drivers/gpu/drm/radeon/radeon_connectors.c | 66 ++++++++---------------------- 3 files changed, 22 insertions(+), 56 deletions(-)
drivers/gpu/drm/radeon/r100.c +2 -4
@@ -1401,7 +1401,6 @@ int r100_cs_parse_packet0(struct radeon_cs_parser *p,*/ int r100_cs_packet_parse_vline (struct radeon_cs_parser *p) { -struct drm_mode_object *obj;struct drm_crtc *crtc;struct radeon_crtc *radeon_crtc;struct radeon_cs_packet p3reloc, waitreloc;
@@ -1441,12 +1440,11 @@ int r100_cs_packet_parse_vline(struct radeon_cs_parser *p) header =radeon_get_ib_value (p, h_idx); crtc_id =radeon_get_ib_value (p, h_idx +5 ); reg =R100_CP_PACKET0_GET_REG (header); - obj =drm_mode_object_find (p->rdev->ddev, crtc_id,DRM_MODE_OBJECT_CRTC ); -if (!obj) { + crtc =drm_crtc_find (p->rdev->ddev, crtc_id); +if (!crtc) {DRM_ERROR ("cannot find crtc %d\n" , crtc_id);return -ENOENT ; } - crtc =obj_to_crtc (obj); radeon_crtc =to_radeon_crtc (crtc); crtc_id = radeon_crtc->crtc_id;
drivers/gpu/drm/radeon/r600_cs.c +2 -4
@@ -825,7 +825,6 @@ int r600_cs_common_vline_parse(struct radeon_cs_parser *p,uint32_t *vline_start_end, uint32_t *vline_status) { - struct drm_mode_object *obj; struct drm_crtc *crtc;struct radeon_crtc *radeon_crtc;struct radeon_cs_packet p3reloc, wait_reg_mem;
@@ -887,12 +886,11 @@ int r600_cs_common_vline_parse(struct radeon_cs_parser *p, crtc_id =radeon_get_ib_value (p, h_idx +2 +7 +1 ); reg =R600_CP_PACKET0_GET_REG (header); - obj =drm_mode_object_find (p->rdev->ddev, crtc_id,DRM_MODE_OBJECT_CRTC ); -if (!obj) { + crtc =drm_crtc_find (p->rdev->ddev, crtc_id); +if (!crtc) {DRM_ERROR ("cannot find crtc %d\n" , crtc_id);return -ENOENT ; } - crtc =obj_to_crtc (obj); radeon_crtc =to_radeon_crtc (crtc); crtc_id = radeon_crtc->crtc_id;
drivers/gpu/drm/radeon/radeon_connectors.c +18 -48
163 lines not on this page · raw message
Signature · 1 line
1.9.3
Quoted 5 lines · Rob Clark
Slightly overdue, but retrofit recently added helpers to drivers. Note that there are a couple places left in core, but they get replaced in the atomic series and I didn't feel like making extra conflicts for myself.
Quoted 11 lines
Rob Clark (10):
drm/ast: use helpers
drm/bochs: use helpers
drm/cirrus: use helpers
drm/exynos: use helpers
drm/mgag200: use helpers
drm/udl: use helpers
drm/vmwgfx: use helpers
drm/nouveau: use helpers
drm/i915: use helpers
drm/radeon: use helpers
Yay! On the entire series: Reviewed-by: Daniel Vetter <[email protected]>
Quoted 24 lines
drivers/gpu/drm/ast/ast_mode.c | 12 +---- drivers/gpu/drm/bochs/bochs_kms.c | 13 +----- drivers/gpu/drm/cirrus/cirrus_mode.c | 14 +----- drivers/gpu/drm/exynos/exynos_drm_connector.c | 15 +----- drivers/gpu/drm/i915/intel_display.c | 9 ++-- drivers/gpu/drm/i915/intel_overlay.c | 9 ++-- drivers/gpu/drm/i915/intel_sprite.c | 12 ++--- drivers/gpu/drm/mgag200/mgag200_mode.c | 14 +----- drivers/gpu/drm/nouveau/nouveau_connector.c | 16 +++---- drivers/gpu/drm/radeon/r100.c | 6 +-- drivers/gpu/drm/radeon/r600_cs.c | 6 +-- drivers/gpu/drm/radeon/radeon_connectors.c | 66 ++++++++------------------- drivers/gpu/drm/udl/udl_connector.c | 9 +--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 +-- 14 files changed, 54 insertions(+), 153 deletions(-)Signature · 6 lines
1.9.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 17 lines · Rob Clark
Slightly overdue, but retrofit recently added helpers to drivers. Note that there are a couple places left in core, but they get replaced in the atomic series and I didn't feel like making extra conflicts for myself.
Rob Clark (10):
drm/ast: use helpers
drm/bochs: use helpers
drm/cirrus: use helpers
drm/exynos: use helpers
drm/mgag200: use helpers
drm/udl: use helpers
drm/vmwgfx: use helpers
drm/nouveau: use helpers
drm/i915: use helpers
drm/radeon: use helpers
Quoted 15 lines
drivers/gpu/drm/ast/ast_mode.c | 12 +---- drivers/gpu/drm/bochs/bochs_kms.c | 13 +----- drivers/gpu/drm/cirrus/cirrus_mode.c | 14 +----- drivers/gpu/drm/exynos/exynos_drm_connector.c | 15 +----- drivers/gpu/drm/i915/intel_display.c | 9 ++-- drivers/gpu/drm/i915/intel_overlay.c | 9 ++-- drivers/gpu/drm/i915/intel_sprite.c | 12 ++--- drivers/gpu/drm/mgag200/mgag200_mode.c | 14 +----- drivers/gpu/drm/nouveau/nouveau_connector.c | 16 +++---- drivers/gpu/drm/radeon/r100.c | 6 +-- drivers/gpu/drm/radeon/r600_cs.c | 6 +-- drivers/gpu/drm/radeon/radeon_connectors.c | 66 ++++++++------------------- drivers/gpu/drm/udl/udl_connector.c | 9 +--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 +-- 14 files changed, 54 insertions(+), 153 deletions(-)
Nice!
For the series:
Quoted 8 lines
--
1.9.3_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel