Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 925c70c

Browse files
committed
drm: Remove drm_num_crtcs() helper
The drm_num_crtcs() helper determines the number of CRTCs by iterating over the list of CRTCs that have been registered with the mode config. However, we already keep track of that number in the mode config's num_crtcs field, so we can simply retrieve the value from that and remove the extra helper function. Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0c59138 commit 925c70c

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/gpu/drm/drm_crtc.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,6 @@ int drm_crtc_force_disable(struct drm_crtc *crtc)
107107
return drm_mode_set_config_internal(&set);
108108
}
109109

110-
static unsigned int drm_num_crtcs(struct drm_device *dev)
111-
{
112-
unsigned int num = 0;
113-
struct drm_crtc *tmp;
114-
115-
drm_for_each_crtc(tmp, dev) {
116-
num++;
117-
}
118-
119-
return num;
120-
}
121-
122110
int drm_crtc_register_all(struct drm_device *dev)
123111
{
124112
struct drm_crtc *crtc;
@@ -278,8 +266,7 @@ static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *
278266
if (name) {
279267
crtc->name = kvasprintf(GFP_KERNEL, name, ap);
280268
} else {
281-
crtc->name = kasprintf(GFP_KERNEL, "crtc-%d",
282-
drm_num_crtcs(dev));
269+
crtc->name = kasprintf(GFP_KERNEL, "crtc-%d", config->num_crtc);
283270
}
284271
if (!crtc->name) {
285272
drm_mode_object_unregister(dev, &crtc->base);

0 commit comments

Comments
 (0)