Rev 3192 | Rev 3298 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3192 | Rev 3243 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | { |
59 | { |
60 | struct drm_device *dev = fb_helper->dev; |
60 | struct drm_device *dev = fb_helper->dev; |
61 | struct drm_connector *connector; |
61 | struct drm_connector *connector; |
62 | int i; |
62 | int i; |
Line 63... | Line -... | ||
63 | - | ||
64 | ENTER(); |
- | |
65 | 63 | ||
66 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
64 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
Line 67... | Line 65... | ||
67 | struct drm_fb_helper_connector *fb_helper_connector; |
65 | struct drm_fb_helper_connector *fb_helper_connector; |
68 | 66 | ||
69 | fb_helper_connector = kzalloc(sizeof(struct drm_fb_helper_connector), GFP_KERNEL); |
67 | fb_helper_connector = kzalloc(sizeof(struct drm_fb_helper_connector), GFP_KERNEL); |
Line 70... | Line 68... | ||
70 | if (!fb_helper_connector) |
68 | if (!fb_helper_connector) |
71 | goto fail; |
69 | goto fail; |
72 | 70 | ||
73 | fb_helper_connector->connector = connector; |
- | |
74 | fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector; |
71 | fb_helper_connector->connector = connector; |
75 | } |
72 | fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector; |
76 | LEAVE(); |
73 | } |
77 | return 0; |
74 | return 0; |
78 | fail: |
75 | fail: |
79 | for (i = 0; i < fb_helper->connector_count; i++) { |
76 | for (i = 0; i < fb_helper->connector_count; i++) { |
80 | kfree(fb_helper->connector_info[i]); |
77 | kfree(fb_helper->connector_info[i]); |
81 | fb_helper->connector_info[i] = NULL; |
- | |
82 | } |
78 | fb_helper->connector_info[i] = NULL; |
83 | fb_helper->connector_count = 0; |
79 | } |
84 | FAIL(); |
80 | fb_helper->connector_count = 0; |
Line 85... | Line 81... | ||
85 | return -ENOMEM; |
81 | return -ENOMEM; |
Line 192... | Line 188... | ||
192 | int crtc_count, int max_conn_count) |
188 | int crtc_count, int max_conn_count) |
193 | { |
189 | { |
194 | struct drm_crtc *crtc; |
190 | struct drm_crtc *crtc; |
195 | int i; |
191 | int i; |
Line 196... | Line -... | ||
196 | - | ||
197 | ENTER(); |
- | |
198 | - | ||
199 | dbgprintf("crtc_count %d max_conn_count %d\n", crtc_count, max_conn_count); |
- | |
200 | 192 | ||
Line 201... | Line 193... | ||
201 | fb_helper->dev = dev; |
193 | fb_helper->dev = dev; |
Line 202... | Line 194... | ||
202 | 194 | ||
203 | INIT_LIST_HEAD(&fb_helper->kernel_fb_list); |
195 | INIT_LIST_HEAD(&fb_helper->kernel_fb_list); |
204 | - | ||
205 | fb_helper->crtc_info = kcalloc(crtc_count, sizeof(struct drm_fb_helper_crtc), GFP_KERNEL); |
- | |
206 | if (!fb_helper->crtc_info) |
196 | |
207 | { |
- | |
Line 208... | Line 197... | ||
208 | FAIL(); |
197 | fb_helper->crtc_info = kcalloc(crtc_count, sizeof(struct drm_fb_helper_crtc), GFP_KERNEL); |
209 | return -ENOMEM; |
198 | if (!fb_helper->crtc_info) |
210 | }; |
199 | return -ENOMEM; |
211 | 200 | ||
212 | fb_helper->crtc_count = crtc_count; |
- | |
213 | fb_helper->connector_info = kcalloc(dev->mode_config.num_connector, sizeof(struct drm_fb_helper_connector *), GFP_KERNEL); |
201 | fb_helper->crtc_count = crtc_count; |
214 | if (!fb_helper->connector_info) { |
202 | fb_helper->connector_info = kcalloc(dev->mode_config.num_connector, sizeof(struct drm_fb_helper_connector *), GFP_KERNEL); |
215 | kfree(fb_helper->crtc_info); |
203 | if (!fb_helper->connector_info) { |
Line 216... | Line 204... | ||
216 | FAIL(); |
204 | kfree(fb_helper->crtc_info); |
Line 233... | Line 221... | ||
233 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
221 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
234 | fb_helper->crtc_info[i].mode_set.crtc = crtc; |
222 | fb_helper->crtc_info[i].mode_set.crtc = crtc; |
235 | i++; |
223 | i++; |
236 | } |
224 | } |
Line 237... | Line -... | ||
237 | - | ||
238 | LEAVE(); |
225 | |
239 | return 0; |
226 | return 0; |
240 | out_free: |
227 | out_free: |
241 | drm_fb_helper_crtc_free(fb_helper); |
- | |
242 | FAIL(); |
228 | drm_fb_helper_crtc_free(fb_helper); |
243 | return -ENOMEM; |
229 | return -ENOMEM; |
244 | } |
230 | } |
Line 245... | Line 231... | ||
245 | EXPORT_SYMBOL(drm_fb_helper_init); |
231 | EXPORT_SYMBOL(drm_fb_helper_init); |
Line 597... | Line 583... | ||
597 | fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; |
583 | fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; |
Line 598... | Line 584... | ||
598 | 584 | ||
599 | if (new_fb) { |
585 | if (new_fb) { |
Line 600... | Line 586... | ||
600 | info->var.pixclock = 0; |
586 | info->var.pixclock = 0; |
601 | 587 | ||
Line 602... | Line 588... | ||
602 | printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, |
588 | dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", |
603 | info->fix.id); |
589 | info->node, info->fix.id); |
604 | 590 | ||
Line 994... | Line 980... | ||
994 | */ |
980 | */ |
995 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) |
981 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) |
996 | { |
982 | { |
997 | struct drm_device *dev = fb_helper->dev; |
983 | struct drm_device *dev = fb_helper->dev; |
998 | int count = 0; |
984 | int count = 0; |
999 | bool ret; |
- | |
1000 | - | ||
1001 | ENTER(); |
- | |
Line 1002... | Line 985... | ||
1002 | 985 | ||
1003 | /* disable all the possible outputs/crtcs before entering KMS mode */ |
986 | /* disable all the possible outputs/crtcs before entering KMS mode */ |
Line 1004... | Line 987... | ||
1004 | drm_helper_disable_unused_functions(fb_helper->dev); |
987 | drm_helper_disable_unused_functions(fb_helper->dev); |
Line 1014... | Line 997... | ||
1014 | if (count == 0) |
997 | if (count == 0) |
1015 | dev_info(fb_helper->dev->dev, "No connectors reported connected with modes\n"); |
998 | dev_info(fb_helper->dev->dev, "No connectors reported connected with modes\n"); |
Line 1016... | Line 999... | ||
1016 | 999 | ||
Line 1017... | Line 1000... | ||
1017 | drm_setup_crtcs(fb_helper); |
1000 | drm_setup_crtcs(fb_helper); |
1018 | - | ||
1019 | ret = drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); |
1001 | |
1020 | LEAVE(); |
1002 | return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); |
Line 1021... | Line 1003... | ||
1021 | } |
1003 | } |
1022 | EXPORT_SYMBOL(drm_fb_helper_initial_config); |
1004 | EXPORT_SYMBOL(drm_fb_helper_initial_config); |