From patchwork Wed Dec 12 16:16:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1869081 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 396C93FC81 for ; Wed, 12 Dec 2012 17:41:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D223E622C for ; Wed, 12 Dec 2012 09:41:15 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 71AD1E5DE5; Wed, 12 Dec 2012 08:20:05 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 12 Dec 2012 08:20:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,267,1355126400"; d="scan'208";a="261177352" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by fmsmga001.fm.intel.com with SMTP; 12 Dec 2012 08:19:47 -0800 Received: by stinkbox (sSMTP sendmail emulation); Wed, 12 Dec 2012 18:19:46 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Date: Wed, 12 Dec 2012 18:16:16 +0200 Message-Id: <1355329008-31459-50-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1355329008-31459-1-git-send-email-ville.syrjala@linux.intel.com> References: <1355329008-31459-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 49/81] drm: Move standard crtc/plane prop handling to drm_crtc.c X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä Move some of the property code to drm_crtc.c since it should be shared by everyone. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 235 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_atomic.c | 256 ---------------------------------- drivers/gpu/drm/i915/intel_display.c | 29 ++++ 3 files changed, 264 insertions(+), 256 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 9d8738f..527b35b 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -4397,3 +4397,238 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, return ret; } + +static void drm_crtc_update_connector_ids_property(struct drm_crtc *crtc) +{ + struct drm_mode_config *config = &crtc->dev->mode_config; + struct drm_connector *connector; + uint64_t value = 0; + int i = 0; + uint32_t connector_ids[config->num_connector]; + + list_for_each_entry(connector, &config->connector_list, head) { + if (connector->encoder && connector->encoder->crtc == crtc) + connector_ids[i++] = connector->base.id; + } + + if (i) { + drm_property_blob_replace_data(crtc->connector_ids_blob, + i * sizeof connector_ids[0], connector_ids); + value = crtc->connector_ids_blob->base.id; + } else + drm_property_blob_replace_data(crtc->connector_ids_blob, 0, NULL); + + drm_object_property_set_value(&crtc->base, config->connector_ids_prop, value); +} + +static void drm_crtc_update_mode_property(struct drm_crtc *crtc) +{ + struct drm_mode_config *config = &crtc->dev->mode_config; + uint64_t value = 0; + + if (crtc->enabled) { + struct drm_mode_modeinfo umode; + + drm_crtc_convert_to_umode(&umode, &crtc->mode); + drm_property_blob_replace_data(crtc->mode_blob, sizeof umode, &umode); + value = crtc->mode_blob->base.id; + } else + drm_property_blob_replace_data(crtc->mode_blob, 0, NULL); + + drm_object_property_set_value(&crtc->base, config->mode_prop, value); +} + +void drm_crtc_update_properties(struct drm_crtc *crtc) +{ + struct drm_mode_object *obj = &crtc->base; + struct drm_mode_config *config = &crtc->dev->mode_config; + + drm_object_property_set_value(obj, config->src_x_prop, crtc->x); + drm_object_property_set_value(obj, config->src_y_prop, crtc->y); + drm_object_property_set_value(obj, config->fb_id_prop, crtc->fb ? crtc->fb->base.id : 0); + + drm_crtc_update_mode_property(crtc); + drm_crtc_update_connector_ids_property(crtc); +} +EXPORT_SYMBOL(drm_crtc_update_properties); + +void drm_plane_update_properties(struct drm_plane *plane) +{ + struct drm_mode_object *obj = &plane->base; + struct drm_mode_config *config = &plane->dev->mode_config; + + drm_object_property_set_value(obj, config->src_x_prop, plane->src_x); + drm_object_property_set_value(obj, config->src_y_prop, plane->src_y); + drm_object_property_set_value(obj, config->src_w_prop, plane->src_w); + drm_object_property_set_value(obj, config->src_h_prop, plane->src_h); + + drm_object_property_set_value(obj, config->crtc_x_prop, plane->crtc_x); + drm_object_property_set_value(obj, config->crtc_y_prop, plane->crtc_y); + drm_object_property_set_value(obj, config->crtc_w_prop, plane->crtc_w); + drm_object_property_set_value(obj, config->crtc_h_prop, plane->crtc_h); + + drm_object_property_set_value(obj, config->fb_id_prop, plane->fb ? plane->fb->base.id : 0); + drm_object_property_set_value(obj, config->crtc_id_prop, plane->crtc ? plane->crtc->base.id : 0); +} +EXPORT_SYMBOL(drm_plane_update_properties); + +int drm_crtc_create_blobs(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + + crtc->mode_blob = drm_property_create_blob(dev, 0, sizeof(struct drm_mode_modeinfo), NULL); + if (!crtc->mode_blob) + return -ENOMEM; + + crtc->connector_ids_blob = drm_property_create_blob(dev, 0, dev->mode_config.num_connector * sizeof(uint32_t), NULL); + if (!crtc->connector_ids_blob) + return -ENOMEM; + + return 0; +} +EXPORT_SYMBOL(drm_crtc_create_blobs); + +void drm_crtc_destroy_blobs(struct drm_crtc *crtc) +{ + struct drm_device *dev = crtc->dev; + + drm_property_destroy_blob(dev, crtc->mode_blob); + drm_property_destroy_blob(dev, crtc->connector_ids_blob); +} +EXPORT_SYMBOL(drm_crtc_destroy_blobs); + +static void drm_property_destroy_null(struct drm_device *dev, struct drm_property **prop) +{ + drm_property_destroy(dev, *prop); + *prop = NULL; +} + +void drm_mode_destroy_properties(struct drm_device *dev) +{ + struct drm_mode_config *config = &dev->mode_config; + + drm_property_destroy_null(dev, &config->cursor_h_prop); + drm_property_destroy_null(dev, &config->cursor_w_prop); + drm_property_destroy_null(dev, &config->cursor_y_prop); + drm_property_destroy_null(dev, &config->cursor_x_prop); + drm_property_destroy_null(dev, &config->cursor_id_prop); + + drm_property_destroy_null(dev, &config->connector_ids_prop); + drm_property_destroy_null(dev, &config->mode_prop); + + drm_property_destroy_null(dev, &config->crtc_id_prop); + drm_property_destroy_null(dev, &config->fb_id_prop); + + drm_property_destroy_null(dev, &config->crtc_h_prop); + drm_property_destroy_null(dev, &config->crtc_w_prop); + drm_property_destroy_null(dev, &config->crtc_y_prop); + drm_property_destroy_null(dev, &config->crtc_x_prop); + + drm_property_destroy_null(dev, &config->src_h_prop); + drm_property_destroy_null(dev, &config->src_w_prop); + drm_property_destroy_null(dev, &config->src_y_prop); + drm_property_destroy_null(dev, &config->src_x_prop); +} +EXPORT_SYMBOL(drm_mode_destroy_properties); + +int drm_mode_create_properties(struct drm_device *dev) +{ + struct drm_mode_config *config = &dev->mode_config; + + config->src_x_prop = drm_property_create_range(dev, 0, "SRC_X", 0, UINT_MAX); + if (!config->src_x_prop) + goto out; + config->src_y_prop = drm_property_create_range(dev, 0, "SRC_Y", 0, UINT_MAX); + if (!config->src_y_prop) + goto out; + config->src_w_prop = drm_property_create_range(dev, 0, "SRC_W", 0, UINT_MAX); + if (!config->src_w_prop) + goto out; + config->src_h_prop = drm_property_create_range(dev, 0, "SRC_H", 0, UINT_MAX); + if (!config->src_h_prop) + goto out; + + config->crtc_x_prop = drm_property_create_range(dev, 0, "CRTC_X", INT_MIN, INT_MAX); + if (!config->crtc_x_prop) + goto out; + config->crtc_y_prop = drm_property_create_range(dev, 0, "CRTC_Y", INT_MIN, INT_MAX); + if (!config->crtc_y_prop) + goto out; + config->crtc_w_prop = drm_property_create_range(dev, 0, "CRTC_W", 0, UINT_MAX); + if (!config->crtc_w_prop) + goto out; + config->crtc_h_prop = drm_property_create_range(dev, 0, "CRTC_H", 0, UINT_MAX); + if (!config->crtc_h_prop) + goto out; + + config->fb_id_prop = drm_property_create_range(dev, 0, "FB_ID", 0, UINT_MAX); + if (!config->fb_id_prop) + goto out; + config->crtc_id_prop = drm_property_create_range(dev, 0, "CRTC_ID", 0, UINT_MAX); + if (!config->crtc_id_prop) + goto out; + + config->cursor_id_prop = drm_property_create_range(dev, 0, "CURSOR_ID", 0, UINT_MAX); + if (!config->cursor_id_prop) + goto out; + config->cursor_x_prop = drm_property_create_range(dev, 0, "CURSOR_X", INT_MIN, INT_MAX); + if (!config->cursor_x_prop) + goto out; + config->cursor_y_prop = drm_property_create_range(dev, 0, "CURSOR_Y", INT_MIN, INT_MAX); + if (!config->cursor_y_prop) + goto out; + config->cursor_w_prop = drm_property_create_range(dev, 0, "CURSOR_W", 0, UINT_MAX); + if (!config->cursor_w_prop) + goto out; + config->cursor_h_prop = drm_property_create_range(dev, 0, "CURSOR_H", 0, UINT_MAX); + if (!config->cursor_h_prop) + goto out; + + /* FIXME create special object ID list property type? */ + config->connector_ids_prop = drm_property_create(dev, DRM_MODE_PROP_BLOB, "CONNECTOR_IDS", 0); + if (!config->connector_ids_prop) + goto out; + + config->mode_prop = drm_property_create(dev, DRM_MODE_PROP_BLOB, "MODE", 0); + if (!config->mode_prop) + goto out; + + return 0; + + out: + drm_mode_destroy_properties(dev); + + return -ENOMEM; /* FIXME? */ +} +EXPORT_SYMBOL(drm_mode_create_properties); + +void drm_plane_attach_properties(struct drm_plane *plane) +{ + struct drm_mode_object *obj = &plane->base; + struct drm_mode_config *config = &plane->dev->mode_config; + + drm_object_attach_property(obj, config->src_x_prop, 0); + drm_object_attach_property(obj, config->src_y_prop, 0); + drm_object_attach_property(obj, config->src_w_prop, 0); + drm_object_attach_property(obj, config->src_h_prop, 0); + drm_object_attach_property(obj, config->crtc_x_prop, 0); + drm_object_attach_property(obj, config->crtc_y_prop, 0); + drm_object_attach_property(obj, config->crtc_w_prop, 0); + drm_object_attach_property(obj, config->crtc_h_prop, 0); + drm_object_attach_property(obj, config->fb_id_prop, 0); + drm_object_attach_property(obj, config->crtc_id_prop, 0); +} +EXPORT_SYMBOL(drm_plane_attach_properties); + +void drm_crtc_attach_properties(struct drm_crtc *crtc) +{ + struct drm_mode_object *obj = &crtc->base; + struct drm_mode_config *config = &crtc->dev->mode_config; + + drm_object_attach_property(obj, config->src_x_prop, 0); + drm_object_attach_property(obj, config->src_y_prop, 0); + drm_object_attach_property(obj, config->fb_id_prop, 0); + drm_object_attach_property(obj, config->mode_prop, 0); + drm_object_attach_property(obj, config->connector_ids_prop, 0); +} +EXPORT_SYMBOL(drm_crtc_attach_properties); diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index 0def947..6dd07fb 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -2278,259 +2278,3 @@ void intel_atomic_clear_flips(struct drm_crtc *crtc) drm_flip_helper_clear(&intel_plane->flip_helper); } } - -static void drm_crtc_update_connector_ids_property(struct drm_crtc *crtc) -{ - struct drm_mode_config *config = &crtc->dev->mode_config; - struct drm_connector *connector; - uint64_t value = 0; - int i = 0; - uint32_t connector_ids[config->num_connector]; - - list_for_each_entry(connector, &config->connector_list, head) { - if (connector->encoder && connector->encoder->crtc == crtc) - connector_ids[i++] = connector->base.id; - } - - if (i) { - drm_property_blob_replace_data(crtc->connector_ids_blob, - i * sizeof connector_ids[0], connector_ids); - value = crtc->connector_ids_blob->base.id; - } else - drm_property_blob_replace_data(crtc->connector_ids_blob, 0, NULL); - - drm_object_property_set_value(&crtc->base, config->connector_ids_prop, value); -} - -static void drm_crtc_update_mode_property(struct drm_crtc *crtc) -{ - struct drm_mode_config *config = &crtc->dev->mode_config; - uint64_t value = 0; - - if (crtc->enabled) { - struct drm_mode_modeinfo umode; - - drm_crtc_convert_to_umode(&umode, &crtc->mode); - drm_property_blob_replace_data(crtc->mode_blob, sizeof umode, &umode); - value = crtc->mode_blob->base.id; - } else - drm_property_blob_replace_data(crtc->mode_blob, 0, NULL); - - drm_object_property_set_value(&crtc->base, config->mode_prop, value); -} - -void drm_crtc_update_properties(struct drm_crtc *crtc) -{ - struct drm_mode_object *obj = &crtc->base; - struct drm_mode_config *config = &crtc->dev->mode_config; - - drm_object_property_set_value(obj, config->src_x_prop, crtc->x); - drm_object_property_set_value(obj, config->src_y_prop, crtc->y); - drm_object_property_set_value(obj, config->fb_id_prop, crtc->fb ? crtc->fb->base.id : 0); - - drm_crtc_update_mode_property(crtc); - drm_crtc_update_connector_ids_property(crtc); -} - -void intel_crtc_update_properties(struct drm_crtc *crtc) -{ - struct drm_mode_object *obj = &crtc->base; - struct drm_mode_config *config = &crtc->dev->mode_config; - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - - drm_crtc_update_properties(crtc); - - drm_object_property_set_value(obj, config->cursor_id_prop, intel_crtc->cursor_handle); - drm_object_property_set_value(obj, config->cursor_x_prop, intel_crtc->cursor_x); - drm_object_property_set_value(obj, config->cursor_y_prop, intel_crtc->cursor_y); - drm_object_property_set_value(obj, config->cursor_w_prop, intel_crtc->cursor_width); - drm_object_property_set_value(obj, config->cursor_h_prop, intel_crtc->cursor_height); -} - -void drm_plane_update_properties(struct drm_plane *plane) -{ - struct drm_mode_object *obj = &plane->base; - struct drm_mode_config *config = &plane->dev->mode_config; - - drm_object_property_set_value(obj, config->src_x_prop, plane->src_x); - drm_object_property_set_value(obj, config->src_y_prop, plane->src_y); - drm_object_property_set_value(obj, config->src_w_prop, plane->src_w); - drm_object_property_set_value(obj, config->src_h_prop, plane->src_h); - - drm_object_property_set_value(obj, config->crtc_x_prop, plane->crtc_x); - drm_object_property_set_value(obj, config->crtc_y_prop, plane->crtc_y); - drm_object_property_set_value(obj, config->crtc_w_prop, plane->crtc_w); - drm_object_property_set_value(obj, config->crtc_h_prop, plane->crtc_h); - - drm_object_property_set_value(obj, config->fb_id_prop, plane->fb ? plane->fb->base.id : 0); - drm_object_property_set_value(obj, config->crtc_id_prop, plane->crtc ? plane->crtc->base.id : 0); -} - -int drm_crtc_create_blobs(struct drm_crtc *crtc) -{ - struct drm_device *dev = crtc->dev; - - crtc->mode_blob = drm_property_create_blob(dev, 0, sizeof(struct drm_mode_modeinfo), NULL); - if (!crtc->mode_blob) - return -ENOMEM; - - crtc->connector_ids_blob = drm_property_create_blob(dev, 0, dev->mode_config.num_connector * sizeof(uint32_t), NULL); - if (!crtc->connector_ids_blob) - return -ENOMEM; - - return 0; -} - -void drm_crtc_destroy_blobs(struct drm_crtc *crtc) -{ - struct drm_device *dev = crtc->dev; - - drm_property_destroy_blob(dev, crtc->mode_blob); - drm_property_destroy_blob(dev, crtc->connector_ids_blob); -} - -void drm_property_destroy_null(struct drm_device *dev, struct drm_property **prop) -{ - drm_property_destroy(dev, *prop); - *prop = NULL; -} - -void drm_mode_destroy_properties(struct drm_device *dev) -{ - struct drm_mode_config *config = &dev->mode_config; - - drm_property_destroy_null(dev, &config->cursor_h_prop); - drm_property_destroy_null(dev, &config->cursor_w_prop); - drm_property_destroy_null(dev, &config->cursor_y_prop); - drm_property_destroy_null(dev, &config->cursor_x_prop); - drm_property_destroy_null(dev, &config->cursor_id_prop); - - drm_property_destroy_null(dev, &config->connector_ids_prop); - drm_property_destroy_null(dev, &config->mode_prop); - - drm_property_destroy_null(dev, &config->crtc_id_prop); - drm_property_destroy_null(dev, &config->fb_id_prop); - - drm_property_destroy_null(dev, &config->crtc_h_prop); - drm_property_destroy_null(dev, &config->crtc_w_prop); - drm_property_destroy_null(dev, &config->crtc_y_prop); - drm_property_destroy_null(dev, &config->crtc_x_prop); - - drm_property_destroy_null(dev, &config->src_h_prop); - drm_property_destroy_null(dev, &config->src_w_prop); - drm_property_destroy_null(dev, &config->src_y_prop); - drm_property_destroy_null(dev, &config->src_x_prop); -} - -int drm_mode_create_properties(struct drm_device *dev) -{ - struct drm_mode_config *config = &dev->mode_config; - - config->src_x_prop = drm_property_create_range(dev, 0, "SRC_X", 0, UINT_MAX); - if (!config->src_x_prop) - goto out; - config->src_y_prop = drm_property_create_range(dev, 0, "SRC_Y", 0, UINT_MAX); - if (!config->src_y_prop) - goto out; - config->src_w_prop = drm_property_create_range(dev, 0, "SRC_W", 0, UINT_MAX); - if (!config->src_w_prop) - goto out; - config->src_h_prop = drm_property_create_range(dev, 0, "SRC_H", 0, UINT_MAX); - if (!config->src_h_prop) - goto out; - - config->crtc_x_prop = drm_property_create_range(dev, 0, "CRTC_X", INT_MIN, INT_MAX); - if (!config->crtc_x_prop) - goto out; - config->crtc_y_prop = drm_property_create_range(dev, 0, "CRTC_Y", INT_MIN, INT_MAX); - if (!config->crtc_y_prop) - goto out; - config->crtc_w_prop = drm_property_create_range(dev, 0, "CRTC_W", 0, UINT_MAX); - if (!config->crtc_w_prop) - goto out; - config->crtc_h_prop = drm_property_create_range(dev, 0, "CRTC_H", 0, UINT_MAX); - if (!config->crtc_h_prop) - goto out; - - config->fb_id_prop = drm_property_create_range(dev, 0, "FB_ID", 0, UINT_MAX); - if (!config->fb_id_prop) - goto out; - config->crtc_id_prop = drm_property_create_range(dev, 0, "CRTC_ID", 0, UINT_MAX); - if (!config->crtc_id_prop) - goto out; - - config->cursor_id_prop = drm_property_create_range(dev, 0, "CURSOR_ID", 0, UINT_MAX); - if (!config->cursor_id_prop) - goto out; - config->cursor_x_prop = drm_property_create_range(dev, 0, "CURSOR_X", INT_MIN, INT_MAX); - if (!config->cursor_x_prop) - goto out; - config->cursor_y_prop = drm_property_create_range(dev, 0, "CURSOR_Y", INT_MIN, INT_MAX); - if (!config->cursor_y_prop) - goto out; - config->cursor_w_prop = drm_property_create_range(dev, 0, "CURSOR_W", 0, UINT_MAX); - if (!config->cursor_w_prop) - goto out; - config->cursor_h_prop = drm_property_create_range(dev, 0, "CURSOR_H", 0, UINT_MAX); - if (!config->cursor_h_prop) - goto out; - - /* FIXME create special object ID list property type? */ - config->connector_ids_prop = drm_property_create(dev, DRM_MODE_PROP_BLOB, "CONNECTOR_IDS", 0); - if (!config->connector_ids_prop) - goto out; - - config->mode_prop = drm_property_create(dev, DRM_MODE_PROP_BLOB, "MODE", 0); - if (!config->mode_prop) - goto out; - - return 0; - - out: - drm_mode_destroy_properties(dev); - - return -ENOMEM; /* FIXME? */ -} - -void drm_plane_attach_properties(struct drm_plane *plane) -{ - struct drm_mode_object *obj = &plane->base; - struct drm_mode_config *config = &plane->dev->mode_config; - - drm_object_attach_property(obj, config->src_x_prop, 0); - drm_object_attach_property(obj, config->src_y_prop, 0); - drm_object_attach_property(obj, config->src_w_prop, 0); - drm_object_attach_property(obj, config->src_h_prop, 0); - drm_object_attach_property(obj, config->crtc_x_prop, 0); - drm_object_attach_property(obj, config->crtc_y_prop, 0); - drm_object_attach_property(obj, config->crtc_w_prop, 0); - drm_object_attach_property(obj, config->crtc_h_prop, 0); - drm_object_attach_property(obj, config->fb_id_prop, 0); - drm_object_attach_property(obj, config->crtc_id_prop, 0); -} - -void drm_crtc_attach_properties(struct drm_crtc *crtc) -{ - struct drm_mode_object *obj = &crtc->base; - struct drm_mode_config *config = &crtc->dev->mode_config; - - drm_object_attach_property(obj, config->src_x_prop, 0); - drm_object_attach_property(obj, config->src_y_prop, 0); - drm_object_attach_property(obj, config->fb_id_prop, 0); - drm_object_attach_property(obj, config->mode_prop, 0); - drm_object_attach_property(obj, config->connector_ids_prop, 0); -} - -void intel_crtc_attach_properties(struct drm_crtc *crtc) -{ - struct drm_mode_object *obj = &crtc->base; - struct drm_mode_config *config = &crtc->dev->mode_config; - - drm_crtc_attach_properties(crtc); - - drm_object_attach_property(obj, config->cursor_id_prop, 0); - drm_object_attach_property(obj, config->cursor_x_prop, 0); - drm_object_attach_property(obj, config->cursor_y_prop, 0); - drm_object_attach_property(obj, config->cursor_w_prop, 0); - drm_object_attach_property(obj, config->cursor_h_prop, 0); -} diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 321c840..451cc3d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9372,3 +9372,32 @@ intel_display_print_error_state(struct seq_file *m, } } #endif + +void intel_crtc_update_properties(struct drm_crtc *crtc) +{ + struct drm_mode_object *obj = &crtc->base; + struct drm_mode_config *config = &crtc->dev->mode_config; + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); + + drm_crtc_update_properties(crtc); + + drm_object_property_set_value(obj, config->cursor_id_prop, intel_crtc->cursor_handle); + drm_object_property_set_value(obj, config->cursor_x_prop, intel_crtc->cursor_x); + drm_object_property_set_value(obj, config->cursor_y_prop, intel_crtc->cursor_y); + drm_object_property_set_value(obj, config->cursor_w_prop, intel_crtc->cursor_width); + drm_object_property_set_value(obj, config->cursor_h_prop, intel_crtc->cursor_height); +} + +void intel_crtc_attach_properties(struct drm_crtc *crtc) +{ + struct drm_mode_object *obj = &crtc->base; + struct drm_mode_config *config = &crtc->dev->mode_config; + + drm_crtc_attach_properties(crtc); + + drm_object_attach_property(obj, config->cursor_id_prop, 0); + drm_object_attach_property(obj, config->cursor_x_prop, 0); + drm_object_attach_property(obj, config->cursor_y_prop, 0); + drm_object_attach_property(obj, config->cursor_w_prop, 0); + drm_object_attach_property(obj, config->cursor_h_prop, 0); +}