Lines Matching refs:crtc
52 struct drm_crtc *crtc;
56 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head)
57 mutex_lock(&crtc->mutex);
66 struct drm_crtc *crtc;
68 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head)
69 mutex_unlock(&crtc->mutex);
535 struct drm_crtc *crtc;
560 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head) {
561 if (crtc->fb == fb) {
562 /* should turn off the crtc */
564 set.crtc = crtc;
568 DRM_ERROR("failed to reset crtc %p when fb was deleted\n", (void *)crtc);
585 * @crtc: CRTC object to init
589 * Inits a new object created as base part of an driver crtc object.
591 int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
596 crtc->dev = dev;
597 crtc->funcs = funcs;
598 crtc->invert_dimensions = false;
601 mutex_init(&crtc->mutex, NULL, MUTEX_DRIVER, NULL);
602 mutex_lock(&crtc->mutex);
604 ret = drm_mode_object_get(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
608 crtc->base.properties = &crtc->properties;
610 list_add_tail(&crtc->head, &dev->mode_config.crtc_list, (caddr_t)crtc);
620 * drm_crtc_cleanup - Cleans up the core crtc usage.
621 * @crtc: CRTC to cleanup
624 * Cleanup @crtc. Removes from drm modesetting space
627 void drm_crtc_cleanup(struct drm_crtc *crtc)
629 struct drm_device *dev = crtc->dev;
631 if (crtc->gamma_store) {
632 kfree(crtc->gamma_store, crtc->gamma_size * sizeof(uint16_t) * 3);
633 crtc->gamma_store = NULL;
636 drm_mode_object_put(dev, &crtc->base);
637 list_del(&crtc->head);
843 * for the scanout engine with the crtc implementation.
900 /* disconnect the plane from the fb and crtc: */
903 plane->crtc = NULL;
1174 struct drm_crtc *crtc;
1182 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head)
1183 group->id_list[group->num_crtcs++] = crtc->base.id;
1292 struct drm_crtc *crtc;
1364 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list,
1366 DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id);
1367 if (put_user(crtc->base.id, crtc_id + copied)) {
1477 struct drm_crtc *crtc;
1492 crtc = obj_to_crtc(obj);
1494 crtc_resp->x = crtc->x;
1495 crtc_resp->y = crtc->y;
1496 crtc_resp->gamma_size = crtc->gamma_size;
1497 if (crtc->fb)
1498 crtc_resp->fb_id = crtc->fb->base.id;
1502 if (crtc->enabled) {
1504 drm_crtc_convert_to_umode(&crtc_resp->mode, &crtc->mode);
1678 if (encoder->crtc)
1679 enc_resp->crtc_id = encoder->crtc->base.id;
1770 if (plane->crtc)
1771 plane_resp->crtc_id = plane->crtc->base.id;
1821 struct drm_crtc *crtc;
1831 * First, find the plane, crtc, and fb objects. If not available,
1848 plane->crtc = NULL;
1857 DRM_DEBUG_KMS("Unknown crtc ID %d\n",
1862 crtc = obj_to_crtc(obj);
1917 ret = plane->funcs->update_plane(plane, crtc, fb,
1924 plane->crtc = crtc;
1947 struct drm_crtc *crtc = set->crtc;
1957 list_for_each_entry(tmp, struct drm_crtc, &crtc->dev->mode_config.crtc_list, head)
1961 ret = crtc->funcs->set_config(set);
1963 /* crtc->fb must be updated by ->set_config, enforces this. */
1964 if (fb != crtc->fb)
1965 DRM_ERROR("fb 0x%lx != crtc->fb 0x%lx", (uintptr_t)fb, (uintptr_t)crtc->fb);
1968 list_for_each_entry(tmp, struct drm_crtc, &crtc->dev->mode_config.crtc_list, head) {
1999 struct drm_crtc *crtc;
2011 /* For some reason crtc x/y offsets are signed internally. */
2023 crtc = obj_to_crtc(obj);
2024 DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id);
2032 if (!crtc->fb) {
2037 fb = crtc->fb;
2067 if (crtc->invert_dimensions)
2077 crtc->invert_dimensions ? " (inverted)" : "");
2137 set.crtc = crtc;
2160 struct drm_crtc *crtc;
2174 crtc = obj_to_crtc(obj);
2176 mutex_lock(&crtc->mutex);
2178 if (!crtc->funcs->cursor_set && !crtc->funcs->cursor_set2) {
2183 if (crtc->funcs->cursor_set2)
2184 ret = crtc->funcs->cursor_set2(crtc, file_priv, req->handle,
2187 ret = crtc->funcs->cursor_set(crtc, file_priv, req->handle,
2192 if (crtc->funcs->cursor_move) {
2193 ret = crtc->funcs->cursor_move(crtc, req->x, req->y);
2200 mutex_unlock(&crtc->mutex);
3176 struct drm_crtc *crtc = obj_to_crtc(obj);
3178 if (crtc->funcs->set_property)
3179 ret = crtc->funcs->set_property(crtc, property, value);
3340 int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
3343 crtc->gamma_size = gamma_size;
3345 crtc->gamma_store = kzalloc(gamma_size * sizeof(uint16_t) * 3, GFP_KERNEL);
3346 if (!crtc->gamma_store) {
3347 crtc->gamma_size = 0;
3359 struct drm_crtc *crtc;
3373 crtc = obj_to_crtc(obj);
3375 if (crtc->funcs->gamma_set == NULL) {
3381 if (crtc_lut->gamma_size != crtc->gamma_size) {
3387 r_base = crtc->gamma_store;
3405 crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0, crtc->gamma_size);
3418 struct drm_crtc *crtc;
3432 crtc = obj_to_crtc(obj);
3435 if (crtc_lut->gamma_size != crtc->gamma_size) {
3441 r_base = crtc->gamma_store;
3468 struct drm_crtc *crtc;
3482 crtc = obj_to_crtc(obj);
3484 mutex_lock(&crtc->mutex);
3485 if (crtc->fb == NULL) {
3494 if (crtc->funcs->page_flip == NULL)
3501 hdisplay = crtc->mode.hdisplay;
3502 vdisplay = crtc->mode.vdisplay;
3504 if (crtc->invert_dimensions)
3509 crtc->x > fb->width - hdisplay ||
3510 crtc->y > fb->height - vdisplay) {
3512 fb->width, fb->height, hdisplay, vdisplay, crtc->x, crtc->y,
3513 crtc->invert_dimensions ? " (inverted)" : "");
3518 if (crtc->fb->pixel_format != fb->pixel_format) {
3551 old_fb = crtc->fb;
3552 ret = crtc->funcs->page_flip(crtc, fb, e);
3564 * Warn if the driver hasn't properly updated the crtc->fb
3569 WARN_ON(crtc->fb != fb);
3579 mutex_unlock(&crtc->mutex);
3586 struct drm_crtc *crtc;
3590 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head)
3591 if (crtc->funcs->reset)
3592 crtc->funcs->reset(crtc);
3894 struct drm_crtc *crtc, *ct;
3939 list_for_each_entry_safe(crtc, ct, struct drm_crtc, &dev->mode_config.crtc_list, head) {
3940 crtc->funcs->destroy(crtc);