@@ -754,8 +754,8 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Set up device info and initial runtime info. */
intel_device_info_driver_create(i915, pdev->device, match_info);
- /* Transitional. To be allocated dynamically. */
- i915->display = &i915->__display;
+ /* FIXME: Error handling. */
+ i915->display = kzalloc(sizeof(struct intel_display), GFP_KERNEL);
intel_display_device_probe(pdev);
@@ -180,7 +180,6 @@ struct drm_i915_private {
struct drm_device drm;
struct intel_display *display;
- struct intel_display __display; /* Transitional. Do not use. */
/* FIXME: Device release actions should all be moved to drmm_ */
bool do_release;
@@ -101,8 +101,8 @@ static void display_destroy(struct drm_device *dev, void *dummy)
*/
int xe_display_create(struct xe_device *xe)
{
- /* Transitional. To be allocated dynamically. */
- xe->display = &xe->__display;
+ /* FIXME: Error handling. */
+ xe->display = kzalloc(sizeof(struct intel_display), GFP_KERNEL);
spin_lock_init(&xe->display->fb_tracking.lock);
@@ -570,7 +570,6 @@ struct xe_device {
* migrating to the right sub-structs
*/
struct intel_display *display;
- struct intel_display __display; /* Transitional. Do not use. */
enum intel_pch pch_type;
struct dram_info {
A quick hack to allocate struct intel_display dynamically. No error handling yet. For xe, xe->display may be NULL for DRM_XE_DISPLAY=n or xe.probe_display=n. This needs to be handled gracefully. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/i915_driver.c | 4 ++-- drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/xe/display/xe_display.c | 4 ++-- drivers/gpu/drm/xe/xe_device_types.h | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)