Rev 1123 | Rev 1126 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1123 | Rev 1125 | ||
---|---|---|---|
Line 220... | Line 220... | ||
220 | if (ret == -EAGAIN) |
220 | if (ret == -EAGAIN) |
221 | goto again; |
221 | goto again; |
Line 222... | Line 222... | ||
222 | 222 | ||
223 | obj->id = new_id; |
223 | obj->id = new_id; |
- | 224 | obj->type = obj_type; |
|
224 | obj->type = obj_type; |
225 | |
225 | return 0; |
226 | return 0; |
Line 226... | Line 227... | ||
226 | } |
227 | } |
227 | 228 | ||
Line 359... | Line 360... | ||
359 | * Inits a new object created as base part of an driver crtc object. |
360 | * Inits a new object created as base part of an driver crtc object. |
360 | */ |
361 | */ |
361 | void drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, |
362 | void drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, |
362 | const struct drm_crtc_funcs *funcs) |
363 | const struct drm_crtc_funcs *funcs) |
363 | { |
364 | { |
- | 365 | ENTRY(); |
|
- | 366 | ||
364 | crtc->dev = dev; |
367 | crtc->dev = dev; |
365 | crtc->funcs = funcs; |
368 | crtc->funcs = funcs; |
Line 366... | Line 369... | ||
366 | 369 | ||
367 | // mutex_lock(&dev->mode_config.mutex); |
370 | // mutex_lock(&dev->mode_config.mutex); |
Line 368... | Line 371... | ||
368 | drm_mode_object_get(dev, &crtc->base, DRM_MODE_OBJECT_CRTC); |
371 | drm_mode_object_get(dev, &crtc->base, DRM_MODE_OBJECT_CRTC); |
369 | 372 | ||
- | 373 | list_add_tail(&crtc->head, &dev->mode_config.crtc_list); |
|
370 | list_add_tail(&crtc->head, &dev->mode_config.crtc_list); |
374 | dev->mode_config.num_crtc++; |
- | 375 | ||
- | 376 | // mutex_unlock(&dev->mode_config.mutex); |
|
371 | dev->mode_config.num_crtc++; |
377 | |
372 | // mutex_unlock(&dev->mode_config.mutex); |
378 | LEAVE(); |
Line 373... | Line 379... | ||
373 | } |
379 | } |
374 | EXPORT_SYMBOL(drm_crtc_init); |
380 | EXPORT_SYMBOL(drm_crtc_init); |
Line 584... | Line 590... | ||
584 | { |
590 | { |
585 | struct drm_property *edid; |
591 | struct drm_property *edid; |
586 | struct drm_property *dpms; |
592 | struct drm_property *dpms; |
587 | int i; |
593 | int i; |
Line -... | Line 594... | ||
- | 594 | ||
588 | 595 | ENTRY(); |
|
589 | /* |
596 | /* |
590 | * Standard properties (apply to all connectors) |
597 | * Standard properties (apply to all connectors) |
591 | */ |
598 | */ |
592 | edid = drm_property_create(dev, DRM_MODE_PROP_BLOB | |
599 | edid = drm_property_create(dev, DRM_MODE_PROP_BLOB | |
Line 599... | Line 606... | ||
599 | for (i = 0; i < ARRAY_SIZE(drm_dpms_enum_list); i++) |
606 | for (i = 0; i < ARRAY_SIZE(drm_dpms_enum_list); i++) |
600 | drm_property_add_enum(dpms, i, drm_dpms_enum_list[i].type, |
607 | drm_property_add_enum(dpms, i, drm_dpms_enum_list[i].type, |
601 | drm_dpms_enum_list[i].name); |
608 | drm_dpms_enum_list[i].name); |
602 | dev->mode_config.dpms_property = dpms; |
609 | dev->mode_config.dpms_property = dpms; |
Line -... | Line 610... | ||
- | 610 | ||
603 | 611 | LEAVE(); |
|
604 | return 0; |
612 | return 0; |
Line 605... | Line 613... | ||
605 | } |
613 | } |
606 | 614 | ||
Line 792... | Line 800... | ||
792 | * Initialize @dev's mode_config structure, used for tracking the graphics |
800 | * Initialize @dev's mode_config structure, used for tracking the graphics |
793 | * configuration of @dev. |
801 | * configuration of @dev. |
794 | */ |
802 | */ |
795 | void drm_mode_config_init(struct drm_device *dev) |
803 | void drm_mode_config_init(struct drm_device *dev) |
796 | { |
804 | { |
- | 805 | ENTRY(); |
|
- | 806 | ||
797 | // mutex_init(&dev->mode_config.mutex); |
807 | // mutex_init(&dev->mode_config.mutex); |
798 | // mutex_init(&dev->mode_config.idr_mutex); |
808 | // mutex_init(&dev->mode_config.idr_mutex); |
799 | INIT_LIST_HEAD(&dev->mode_config.fb_list); |
809 | INIT_LIST_HEAD(&dev->mode_config.fb_list); |
800 | INIT_LIST_HEAD(&dev->mode_config.fb_kernel_list); |
810 | INIT_LIST_HEAD(&dev->mode_config.fb_kernel_list); |
801 | INIT_LIST_HEAD(&dev->mode_config.crtc_list); |
811 | INIT_LIST_HEAD(&dev->mode_config.crtc_list); |
802 | INIT_LIST_HEAD(&dev->mode_config.connector_list); |
812 | INIT_LIST_HEAD(&dev->mode_config.connector_list); |
803 | INIT_LIST_HEAD(&dev->mode_config.encoder_list); |
813 | INIT_LIST_HEAD(&dev->mode_config.encoder_list); |
804 | INIT_LIST_HEAD(&dev->mode_config.property_list); |
814 | INIT_LIST_HEAD(&dev->mode_config.property_list); |
805 | INIT_LIST_HEAD(&dev->mode_config.property_blob_list); |
815 | INIT_LIST_HEAD(&dev->mode_config.property_blob_list); |
- | 816 | ||
806 | idr_init(&dev->mode_config.crtc_idr); |
817 | idr_init(&dev->mode_config.crtc_idr); |
Line 807... | Line 818... | ||
807 | 818 | ||
808 | // mutex_lock(&dev->mode_config.mutex); |
819 | // mutex_lock(&dev->mode_config.mutex); |
809 | drm_mode_create_standard_connector_properties(dev); |
820 | drm_mode_create_standard_connector_properties(dev); |
Line 812... | Line 823... | ||
812 | /* Just to be sure */ |
823 | /* Just to be sure */ |
813 | dev->mode_config.num_fb = 0; |
824 | dev->mode_config.num_fb = 0; |
814 | dev->mode_config.num_connector = 0; |
825 | dev->mode_config.num_connector = 0; |
815 | dev->mode_config.num_crtc = 0; |
826 | dev->mode_config.num_crtc = 0; |
816 | dev->mode_config.num_encoder = 0; |
827 | dev->mode_config.num_encoder = 0; |
- | 828 | ||
- | 829 | LEAVE(); |
|
- | 830 | ||
817 | } |
831 | } |
818 | EXPORT_SYMBOL(drm_mode_config_init); |
832 | EXPORT_SYMBOL(drm_mode_config_init); |
Line 819... | Line 833... | ||
819 | 833 | ||
820 | int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group) |
834 | int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group) |
Line 1944... | Line 1958... | ||
1944 | if (!property->values) |
1958 | if (!property->values) |
1945 | goto fail; |
1959 | goto fail; |
1946 | } |
1960 | } |
Line 1947... | Line 1961... | ||
1947 | 1961 | ||
- | 1962 | drm_mode_object_get(dev, &property->base, DRM_MODE_OBJECT_PROPERTY); |
|
1948 | drm_mode_object_get(dev, &property->base, DRM_MODE_OBJECT_PROPERTY); |
1963 | |
1949 | property->flags = flags; |
1964 | property->flags = flags; |
1950 | property->num_values = num_values; |
1965 | property->num_values = num_values; |
Line 1951... | Line 1966... | ||
1951 | INIT_LIST_HEAD(&property->enum_blob_list); |
1966 | INIT_LIST_HEAD(&property->enum_blob_list); |
1952 | 1967 | ||
Line -... | Line 1968... | ||
- | 1968 | if (name) |
|
1953 | if (name) |
1969 | strncpy(property->name, name, DRM_PROP_NAME_LEN); |
- | 1970 | ||
- | 1971 | ||
- | 1972 | list_add_tail(&property->head, &dev->mode_config.property_list); |
|
1954 | strncpy(property->name, name, DRM_PROP_NAME_LEN); |
1973 | |
1955 | 1974 | dbgprintf("%s %x name %s\n", __FUNCTION__, property, name); |
|
1956 | list_add_tail(&property->head, &dev->mode_config.property_list); |
1975 | |
1957 | return property; |
1976 | return property; |
1958 | fail: |
1977 | fail: |