diff --git a/core/includes/entity.inc b/core/includes/entity.inc
index 0dc4426014..22c4e8f58f 100644
--- a/core/includes/entity.inc
+++ b/core/includes/entity.inc
@@ -6,8 +6,6 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Entity\Entity\EntityFormDisplay;
-use Drupal\Core\Entity\Entity\EntityViewDisplay;
 
 /**
  * Clears the entity render cache for all entity types.
@@ -440,49 +438,15 @@ function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $re
  * @return \Drupal\Core\Entity\Display\EntityViewDisplayInterface
  *   The entity view display associated with the view mode.
  *
- * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
- *   If the display is available in configuration use:
- *   @code
- *   \Drupal::entityTypeManager()
- *     ->getStorage('entity_view_display')
- *     ->load($entity_type . '.' . $bundle . '.' . $view_mode);
- *   @endcode
- *   When the display is not available in configuration, you can create a new
- *   EntityViewDisplay object using:
- *   @code
- *   $values = array(
- *     'targetEntityType' => $entity_type,
- *     'bundle' => $bundle,
- *     'mode' => $view_mode,
- *     'status' => TRUE,
- *   );
- *   \Drupal::entityTypeManager()
- *     ->getStorage('entity_view_display')
- *     ->create($values);
- *   @endcode
+ * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Use
+ *   EntityDisplayRepositoryInterface::getViewDisplay() instead.
  *
- * @see \Drupal\Core\Entity\EntityStorageInterface::create()
- * @see \Drupal\Core\Entity\EntityStorageInterface::load()
+ * @see https://www.drupal.org/node/2835616
  */
 function entity_get_display($entity_type, $bundle, $view_mode) {
-  // Try loading the display from configuration.
-  $display = EntityViewDisplay::load($entity_type . '.' . $bundle . '.' . $view_mode);
-
-  // If not found, create a fresh display object. We do not preemptively create
-  // new entity_view_display configuration entries for each existing entity type
-  // and bundle whenever a new view mode becomes available. Instead,
-  // configuration entries are only created when a display object is explicitly
-  // configured and saved.
-  if (!$display) {
-    $display = EntityViewDisplay::create([
-      'targetEntityType' => $entity_type,
-      'bundle' => $bundle,
-      'mode' => $view_mode,
-      'status' => TRUE,
-    ]);
-  }
-
-  return $display;
+  @trigger_error('entity_get_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service(\'entity_display.repository\')->getViewDisplay() instead. See https://www.drupal.org/node/2835616', E_USER_DEPRECATED);
+  return \Drupal::service('entity_display.repository')
+    ->getViewDisplay($entity_type, $bundle, $view_mode);
 }
 
 /**
@@ -520,47 +484,15 @@ function entity_get_display($entity_type, $bundle, $view_mode) {
  * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface
  *   The entity form display associated with the given form mode.
  *
- * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
- *   If the entity form display is available in configuration use:
- *   @code
- *     \Drupal::entityTypeManager()
- *       ->getStorage('entity_form_display')
- *       ->load($entity_type . '.' . $bundle . '.' . $form_mode);
- *   @endcode
- *   When the entity form display is not available in configuration, you can
- *   create a new EntityFormDisplay object using:
- *   @code
- *   $values = array(
- *    'targetEntityType' => $entity_type,
- *    'bundle' => $bundle,
- *    'mode' => $form_mode,
- *    'status' => TRUE,
- *   );
- *   \Drupal::entityTypeManager()
- *     ->getStorage('entity_form_display')
- *     ->create($values);
- *   @endcode
+ * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Use
+ * EntityDisplayRepositoryInterface::getFormDisplay() instead.
  *
+ * @see https://www.drupal.org/node/2835616
  * @see \Drupal\Core\Entity\EntityStorageInterface::create()
  * @see \Drupal\Core\Entity\EntityStorageInterface::load()
  */
 function entity_get_form_display($entity_type, $bundle, $form_mode) {
-  // Try loading the entity from configuration.
-  $entity_form_display = EntityFormDisplay::load($entity_type . '.' . $bundle . '.' . $form_mode);
-
-  // If not found, create a fresh entity object. We do not preemptively create
-  // new entity form display configuration entries for each existing entity type
-  // and bundle whenever a new form mode becomes available. Instead,
-  // configuration entries are only created when an entity form display is
-  // explicitly configured and saved.
-  if (!$entity_form_display) {
-    $entity_form_display = EntityFormDisplay::create([
-      'targetEntityType' => $entity_type,
-      'bundle' => $bundle,
-      'mode' => $form_mode,
-      'status' => TRUE,
-    ]);
-  }
-
-  return $entity_form_display;
+  @trigger_error('entity_get_form_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service(\'entity_display.repository\')->getFormDisplay() instead. See https://www.drupal.org/node/2835616', E_USER_DEPRECATED);
+  return \Drupal::service('entity_display.repository')
+    ->getFormDisplay($entity_type, $bundle, $form_mode);
 }
diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
index c282427028..6b331b22f4 100644
--- a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
+++ b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
@@ -52,10 +52,11 @@ class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayIn
    *
    * This method should only be used internally when rendering an entity form.
    * When assigning suggested display options for a component in a given form
-   * mode, entity_get_form_display() should be used instead, in order to avoid
-   * inadvertently modifying the output of other form modes that might happen to
-   * use the 'default' display too. Those options will then be effectively
-   * applied only if the form mode is configured to use them.
+   * mode, EntityDisplayRepositoryInterface::getFormDisplay() should be used
+   * instead, in order to avoid inadvertently modifying the output of other form
+   * modes that might happen to use the 'default' display too. Those options
+   * will then be effectively applied only if the form mode is configured to use
+   * them.
    *
    * hook_entity_form_display_alter() is invoked on each display, allowing 3rd
    * party code to alter the display options held in the display before they are
@@ -73,7 +74,7 @@ class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayIn
    * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface
    *   The display object that should be used to build the entity form.
    *
-   * @see entity_get_form_display()
+   * @see \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormDisplay()
    * @see hook_entity_form_display_alter()
    */
   public static function collectRenderDisplay(FieldableEntityInterface $entity, $form_mode, $default_fallback = TRUE) {
diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
index 6783522ac9..8ae9e72821 100644
--- a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
+++ b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
@@ -51,10 +51,10 @@ class EntityViewDisplay extends EntityDisplayBase implements EntityViewDisplayIn
    *
    * This method should only be used internally when rendering an entity. When
    * assigning suggested display options for a component in a given view mode,
-   * entity_get_display() should be used instead, in order to avoid
-   * inadvertently modifying the output of other view modes that might happen to
-   * use the 'default' display too. Those options will then be effectively
-   * applied only if the view mode is configured to use them.
+   * EntityDisplayRepositoryInterface::getViewDisplay() should be used instead,
+   * in order to avoid inadvertently modifying the output of other view modes
+   * that might happen to use the 'default' display too. Those options will then
+   * be effectively applied only if the view mode is configured to use them.
    *
    * hook_entity_view_display_alter() is invoked on each display, allowing 3rd
    * party code to alter the display options held in the display before they are
@@ -69,7 +69,7 @@ class EntityViewDisplay extends EntityDisplayBase implements EntityViewDisplayIn
    *   The display objects to use to render the entities, keyed by entity
    *   bundle.
    *
-   * @see entity_get_display()
+   * @see \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewDisplay()
    * @see hook_entity_view_display_alter()
    */
   public static function collectRenderDisplays($entities, $view_mode) {
diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php b/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php
index d959881eac..972a883840 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php
@@ -243,4 +243,50 @@ public function clearDisplayModeInfo() {
     return $this;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getViewDisplay($entity_type, $bundle, $view_mode = self::DEFAULT_DISPLAY_MODE) {
+    $storage = $this->entityTypeManager->getStorage('entity_view_display');
+
+    // Try loading the display from configuration; if not found, create a fresh
+    // display object. We do not preemptively create new entity_view_display
+    // configuration entries for each existing entity type and bundle whenever a
+    // new view mode becomes available. Instead, configuration entries are only
+    // created when a display object is explicitly configured and saved.
+    $entity_view_display = $storage->load($entity_type . '.' . $bundle . '.' . $view_mode);
+    if (!$entity_view_display) {
+      $entity_view_display = $storage->create([
+        'targetEntityType' => $entity_type,
+        'bundle' => $bundle,
+        'mode' => $view_mode,
+        'status' => TRUE,
+      ]);
+    }
+    return $entity_view_display;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormDisplay($entity_type, $bundle, $form_mode = self::DEFAULT_DISPLAY_MODE) {
+    $storage = $this->entityTypeManager->getStorage('entity_form_display');
+
+    // Try loading the entity from configuration; if not found, create a fresh
+    // entity object. We do not preemptively create new entity form display
+    // configuration entries for each existing entity type and bundle whenever a
+    // new form mode becomes available. Instead, configuration entries are only
+    // created when an entity form display is explicitly configured and saved.
+    $entity_form_display = $storage->load($entity_type . '.' . $bundle . '.' . $form_mode);
+    if (!$entity_form_display) {
+      $entity_form_display = $storage->create([
+        'targetEntityType' => $entity_type,
+        'bundle' => $bundle,
+        'mode' => $form_mode,
+        'status' => TRUE,
+      ]);
+    }
+    return $entity_form_display;
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayRepositoryInterface.php b/core/lib/Drupal/Core/Entity/EntityDisplayRepositoryInterface.php
index 44c41b1254..7354869c53 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayRepositoryInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayRepositoryInterface.php
@@ -7,6 +7,13 @@
  */
 interface EntityDisplayRepositoryInterface {
 
+  /**
+   * The default display mode ID.
+   *
+   * @var string
+   */
+  const DEFAULT_DISPLAY_MODE = 'default';
+
   /**
    * Gets the entity view mode info for all entity types.
    *
@@ -100,4 +107,86 @@ public function getFormModeOptionsByBundle($entity_type_id, $bundle);
    */
   public function clearDisplayModeInfo();
 
+  /**
+   * Returns the entity view display associated with a bundle and view mode.
+   *
+   * Use this function when assigning suggested display options for a component
+   * in a given view mode. Note that they will only be actually used at render
+   * time if the view mode itself is configured to use dedicated display
+   * settings for the bundle; if not, the 'default' display is used instead.
+   *
+   * The function reads the entity view display from the current configuration,
+   * or returns a ready-to-use empty one if configuration entry exists yet for
+   * this bundle and view mode. This streamlines manipulation of display objects
+   * by always returning a consistent object that reflects the current state of
+   * the configuration.
+   *
+   * Example usage:
+   * - Set the 'body' field to be displayed and the 'field_image' field to be
+   *   hidden on article nodes in the 'default' display.
+   * @code
+   * \Drupal::service('entity_display.repository')
+   *   ->getViewDisplay('node', 'article', 'default')
+   *   ->setComponent('body', array(
+   *     'type' => 'text_summary_or_trimmed',
+   *     'settings' => array('trim_length' => '200')
+   *     'weight' => 1,
+   *   ))
+   *   ->removeComponent('field_image')
+   *   ->save();
+   * @endcode
+   *
+   * @param string $entity_type
+   *   The entity type.
+   * @param string $bundle
+   *   The bundle.
+   * @param string $view_mode
+   *   (optional) The view mode. Defaults to self::DEFAULT_DISPLAY_MODE.
+   *
+   * @return \Drupal\Core\Entity\Display\EntityViewDisplayInterface
+   *   The entity view display associated with the view mode.
+   */
+  public function getViewDisplay($entity_type, $bundle, $view_mode = self::DEFAULT_DISPLAY_MODE);
+
+  /**
+   * Returns the entity form display associated with a bundle and form mode.
+   *
+   * The function reads the entity form display object from the current
+   * configuration, or returns a ready-to-use empty one if no configuration
+   * entry exists yet for this bundle and form mode. This streamlines
+   * manipulation of entity form displays by always returning a consistent
+   * object that reflects the current state of the configuration.
+   *
+   * Example usage:
+   * - Set the 'body' field to be displayed with the
+   *   'text_textarea_with_summary' widget and the 'field_image' field to be
+   *   hidden on article nodes in the 'default' form mode.
+   * @code
+   * \Drupal::service('entity_display.repository')
+   *   ->getFormDisplay('node', 'article', 'default')
+   *   ->setComponent('body', array(
+   *     'type' => 'text_textarea_with_summary',
+   *     'weight' => 1,
+   *   ))
+   *   ->setComponent('field_image', array(
+   *     'region' => 'hidden',
+   *   ))
+   *   ->save();
+   * @endcode
+   *
+   * @param string $entity_type
+   *   The entity type.
+   * @param string $bundle
+   *   The bundle.
+   * @param string $form_mode
+   *   (optional) The form mode. Defaults to self::DEFAULT_DISPLAY_MODE.
+   *
+   * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface
+   *   The entity form display associated with the given form mode.
+   *
+   * @see \Drupal\Core\Entity\EntityStorageInterface::create()
+   * @see \Drupal\Core\Entity\EntityStorageInterface::load()
+   */
+  public function getFormDisplay($entity_type, $bundle, $form_mode = self::DEFAULT_DISPLAY_MODE);
+
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php
index 475e051fa0..60316d1161 100644
--- a/core/lib/Drupal/Core/Entity/EntityManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityManager.php
@@ -851,4 +851,28 @@ public function getInstance(array $options) {
     return $this->container->get('entity_type.manager')->getInstance($options);
   }
 
+  /**
+   * {@inheritdoc}
+   *
+   * @deprecated in drupal:8.8.0, will be removed before drupal:9.0.0.
+   *   Use \Drupal\Core\Entity\EntityTypeManagerInterface::getViewDisplay()
+   *   instead.
+   */
+  public function getViewDisplay($entity_type, $bundle, $view_mode = self::DEFAULT_DISPLAY_MODE) {
+    @trigger_error('EntityManager::getViewDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service(\'entity_display.repository\')->getViewDisplay() instead.', E_USER_DEPRECATED);
+    return $this->container->get('entity_display.repository')->getViewDisplay($entity_type, $bundle, $view_mode);
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * @deprecated in drupal:8.8.0, will be removed before drupal:9.0.0.
+   *   Use \Drupal\Core\Entity\EntityTypeManagerInterface::getFormwDisplay()
+   *   instead.
+   */
+  public function getFormDisplay($entity_type, $bundle, $form_mode = self::DEFAULT_DISPLAY_MODE) {
+    @trigger_error('EntityManager::getFormDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service(\'entity_display.repository\')->getFormDisplay() instead.', E_USER_DEPRECATED);
+    return $this->container->get('entity_display.repository')->getFormDisplay($entity_type, $bundle, $form_mode);
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/FieldItemList.php b/core/lib/Drupal/Core/Field/FieldItemList.php
index d3eb205a02..5dd4f376bf 100644
--- a/core/lib/Drupal/Core/Field/FieldItemList.php
+++ b/core/lib/Drupal/Core/Field/FieldItemList.php
@@ -351,7 +351,8 @@ protected function defaultValueWidget(FormStateInterface $form_state) {
 
       // Use the widget currently configured for the 'default' form mode, or
       // fallback to the default widget for the field type.
-      $entity_form_display = entity_get_form_display($entity->getEntityTypeId(), $entity->bundle(), 'default');
+      $entity_form_display = \Drupal::service('entity_display.repository')
+        ->getFormDisplay($entity->getEntityTypeId(), $entity->bundle());
       $widget = $entity_form_display->getRenderer($this->getFieldDefinition()->getName());
       if (!$widget) {
         $widget = \Drupal::service('plugin.manager.field.widget')->getInstance(['field_definition' => $this->getFieldDefinition()]);
diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module
index ed7ffa1a8f..6b9446b89e 100644
--- a/core/modules/block_content/block_content.module
+++ b/core/modules/block_content/block_content.module
@@ -91,15 +91,18 @@ function block_content_add_body_field($block_type_id, $label = 'Body') {
     ]);
     $field->save();
 
-    // Assign widget settings for the 'default' form mode.
-    entity_get_form_display('block_content', $block_type_id, 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    // Assign widget settings for the default form mode.
+    $display_repository->getFormDisplay('block_content', $block_type_id)
       ->setComponent('body', [
         'type' => 'text_textarea_with_summary',
       ])
       ->save();
 
-    // Assign display settings for 'default' view mode.
-    entity_get_display('block_content', $block_type_id, 'default')
+    // Assign display settings for default view mode.
+    $display_repository->getViewDisplay('block_content', $block_type_id)
       ->setComponent('body', [
         'label' => 'hidden',
         'type' => 'text_default',
diff --git a/core/modules/comment/src/CommentManager.php b/core/modules/comment/src/CommentManager.php
index 4f5919a333..5c820f466f 100644
--- a/core/modules/comment/src/CommentManager.php
+++ b/core/modules/comment/src/CommentManager.php
@@ -129,15 +129,18 @@ public function addBodyField($comment_type_id) {
       ]);
       $field->save();
 
-      // Assign widget settings for the 'default' form mode.
-      entity_get_form_display('comment', $comment_type_id, 'default')
+      /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+      $display_repository = \Drupal::service('entity_display.repository');
+
+      // Assign widget settings for the default form mode.
+      $display_repository->getFormDisplay('comment', $comment_type_id)
         ->setComponent('comment_body', [
           'type' => 'text_textarea',
         ])
         ->save();
 
-      // Assign display settings for the 'default' view mode.
-      entity_get_display('comment', $comment_type_id, 'default')
+      // Assign display settings for the default view mode.
+      $display_repository->getViewDisplay('comment', $comment_type_id)
         ->setComponent('comment_body', [
           'label' => 'hidden',
           'type' => 'text_default',
diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php
index 22a842e2f7..b3c3d990b1 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -131,7 +131,7 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $
     }
 
     // Determine the visibility of subject form field.
-    if (entity_get_form_display('comment', 'comment', 'default')->getComponent('subject')) {
+    if (\Drupal::service('entity_display.repository')->getFormDisplay('comment', 'comment')->getComponent('subject')) {
       // Subject input allowed.
       $edit['subject[0][value]'] = $subject;
     }
@@ -234,7 +234,8 @@ public function deleteComment(CommentInterface $comment) {
    *   Boolean specifying whether the subject field should be enabled.
    */
   public function setCommentSubject($enabled) {
-    $form_display = entity_get_form_display('comment', 'comment', 'default');
+    $form_display = \Drupal::service('entity_display.repository')
+      ->getFormDisplay('comment', 'comment');
     if ($enabled) {
       $form_display->setComponent('subject', [
         'type' => 'string_textfield',
diff --git a/core/modules/comment/src/Tests/CommentTestTrait.php b/core/modules/comment/src/Tests/CommentTestTrait.php
index 0c0d65de16..6a1fdb3722 100644
--- a/core/modules/comment/src/Tests/CommentTestTrait.php
+++ b/core/modules/comment/src/Tests/CommentTestTrait.php
@@ -87,25 +87,25 @@ public function addDefaultCommentField($entity_type, $bundle, $field_name = 'com
         ],
       ])->save();
 
-      // Entity form displays: assign widget settings for the 'default' form
+      // Entity form displays: assign widget settings for the default form
       // mode, and hide the field in all other form modes.
-      entity_get_form_display($entity_type, $bundle, 'default')
+      $entity_display_repository->getFormDisplay($entity_type, $bundle)
         ->setComponent($field_name, [
           'type' => 'comment_default',
           'weight' => 20,
         ])
         ->save();
       foreach ($entity_display_repository->getFormModes($entity_type) as $id => $form_mode) {
-        $display = entity_get_form_display($entity_type, $bundle, $id);
+        $display = $entity_display_repository->getFormDisplay($entity_type, $bundle, $id);
         // Only update existing displays.
         if ($display && !$display->isNew()) {
           $display->removeComponent($field_name)->save();
         }
       }
 
-      // Entity view displays: assign widget settings for the 'default' view
+      // Entity view displays: assign widget settings for the default view
       // mode, and hide the field in all other view modes.
-      entity_get_display($entity_type, $bundle, 'default')
+      $entity_display_repository->getViewDisplay($entity_type, $bundle)
         ->setComponent($field_name, [
           'label' => 'above',
           'type' => 'comment_default',
@@ -114,7 +114,7 @@ public function addDefaultCommentField($entity_type, $bundle, $field_name = 'com
         ])
         ->save();
       foreach ($entity_display_repository->getViewModes($entity_type) as $id => $view_mode) {
-        $display = entity_get_display($entity_type, $bundle, $id);
+        $display = $entity_display_repository->getViewDisplay($entity_type, $bundle, $id);
         // Only update existing displays.
         if ($display && !$display->isNew()) {
           $display->removeComponent($field_name)->save();
diff --git a/core/modules/comment/tests/src/Functional/CommentLinksTest.php b/core/modules/comment/tests/src/Functional/CommentLinksTest.php
index 20876a28c4..c17ad8e80e 100644
--- a/core/modules/comment/tests/src/Functional/CommentLinksTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLinksTest.php
@@ -101,8 +101,10 @@ public function testCommentLinks() {
       $this->assertLink('Add new comment');
     }
 
+    $display_repository = $this->container->get('entity_display.repository');
+
     // Change weight to make links go before comment body.
-    entity_get_display('comment', 'comment', 'default')
+    $display_repository->getViewDisplay('comment', 'comment')
       ->setComponent('links', ['weight' => -100])
       ->save();
     $this->drupalGet($this->node->toUrl());
@@ -112,7 +114,7 @@ public function testCommentLinks() {
     $this->assertIdentical($element->getTagName(), 'div', 'Last element is comment body.');
 
     // Change weight to make links go after comment body.
-    entity_get_display('comment', 'comment', 'default')
+    $display_repository->getViewDisplay('comment', 'comment')
       ->setComponent('links', ['weight' => 100])
       ->save();
     $this->drupalGet($this->node->toUrl());
@@ -122,7 +124,7 @@ public function testCommentLinks() {
     $this->assertNotEmpty($element->find('css', 'ul.links'), 'Last element is comment links.');
 
     // Make sure we can hide node links.
-    entity_get_display('node', $this->node->bundle(), 'default')
+    $display_repository->getViewDisplay('node', $this->node->bundle())
       ->removeComponent('links')
       ->save();
     $this->drupalGet($this->node->toUrl());
@@ -135,7 +137,7 @@ public function testCommentLinks() {
     $this->assertLink('Reply');
 
     // Make sure we can hide comment links.
-    entity_get_display('comment', 'comment', 'default')
+    $display_repository->getViewDisplay('comment', 'comment')
       ->removeComponent('links')
       ->save();
     $this->drupalGet('node/' . $this->node->id());
diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
index 69e37ffd07..505dbf2743 100644
--- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
@@ -122,7 +122,8 @@ public function postComment(EntityInterface $entity, $comment, $subject = '', $c
     }
 
     // Determine the visibility of subject form field.
-    if (entity_get_form_display('comment', 'comment', 'default')->getComponent('subject')) {
+    $display_repository = $this->container->get('entity_display.repository');
+    if ($display_repository->getFormDisplay('comment', 'comment')->getComponent('subject')) {
       // Subject input allowed.
       $edit['subject[0][value]'] = $subject;
     }
diff --git a/core/modules/comment/tests/src/Functional/CommentPagerTest.php b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
index b0532ce395..ff5f17cf45 100644
--- a/core/modules/comment/tests/src/Functional/CommentPagerTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
@@ -321,7 +321,8 @@ public function testTwoPagers() {
     // Add another field to article content-type.
     $this->addDefaultCommentField('node', 'article', 'comment_2');
     // Set default to display comment list with unique pager id.
-    entity_get_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article')
       ->setComponent('comment_2', [
         'label' => 'hidden',
         'type' => 'comment_default',
diff --git a/core/modules/comment/tests/src/Functional/CommentTestBase.php b/core/modules/comment/tests/src/Functional/CommentTestBase.php
index 09d3b8e340..9574681872 100644
--- a/core/modules/comment/tests/src/Functional/CommentTestBase.php
+++ b/core/modules/comment/tests/src/Functional/CommentTestBase.php
@@ -125,7 +125,8 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $
     }
 
     // Determine the visibility of subject form field.
-    if (entity_get_form_display('comment', 'comment', 'default')->getComponent('subject')) {
+    $display_repository = $this->container->get('entity_display.repository');
+    if ($display_repository->getFormDisplay('comment', 'comment')->getComponent('subject')) {
       // Subject input allowed.
       $edit['subject[0][value]'] = $subject;
     }
@@ -228,7 +229,9 @@ public function deleteComment(CommentInterface $comment) {
    *   Boolean specifying whether the subject field should be enabled.
    */
   public function setCommentSubject($enabled) {
-    $form_display = entity_get_form_display('comment', 'comment', 'default');
+    $form_display = $this->container->get('entity_display.repository')
+      ->getFormDisplay('comment', 'comment');
+
     if ($enabled) {
       $form_display->setComponent('subject', [
         'type' => 'string_textfield',
diff --git a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
index cbabffb03a..ac1edc3b47 100644
--- a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
@@ -112,20 +112,21 @@ public function testExportImport() {
       'field_storage' => $this->fieldStorage,
       'bundle' => $this->contentType->id(),
     ])->save();
+    $display_repository = $this->container->get('entity_display.repository');
     // Update the displays so that configuration does not change unexpectedly on
     // import.
-    entity_get_form_display('node', $this->contentType->id(), 'default')
+    $display_repository->getFormDisplay('node', $this->contentType->id(), 'default')
       ->setComponent($this->fieldName, [
         'type' => 'text_textfield',
       ])
       ->save();
-    entity_get_display('node', $this->contentType->id(), 'full')
+    $display_repository->getViewDisplay('node', $this->contentType->id(), 'full')
       ->setComponent($this->fieldName)
       ->save();
-    entity_get_display('node', $this->contentType->id(), 'default')
+    $display_repository->getViewDisplay('node', $this->contentType->id(), 'default')
       ->setComponent($this->fieldName)
       ->save();
-    entity_get_display('node', $this->contentType->id(), 'teaser')
+    $display_repository->getViewDisplay('node', $this->contentType->id(), 'teaser')
       ->removeComponent($this->fieldName)
       ->save();
 
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index ec453715ed..9d7eee3e5d 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -449,7 +449,8 @@ public function testAutoReply() {
     // Verify that the current error message doesn't show, that the auto-reply
     // doesn't get sent and the correct silent error gets logged.
     $email = '';
-    entity_get_form_display('contact_message', 'foo', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('contact_message', 'foo')
       ->removeComponent('mail')
       ->save();
     $this->submitContact($this->randomMachineName(16), $email, $this->randomString(64), 'foo', $this->randomString(128));
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
index e831649c33..2f4158bec2 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
@@ -198,7 +198,8 @@ protected function setupTestFields() {
       'bundle' => $this->bundle,
       'label' => 'Test translatable text-field',
     ])->save();
-    entity_get_form_display($this->entityTypeId, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->entityTypeId, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'string_textfield',
         'weight' => 0,
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
index b85c3aad5d..8042d91007 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
@@ -79,7 +79,8 @@ protected function setUp() {
       'bundle' => $this->bundle,
       'label' => 'Test text-field',
     ])->save();
-    entity_get_form_display('node', $this->bundle, 'default')
+    $this->container->get('entity_display.repository')
+      ->getFormDisplay('node', $this->bundle)
       ->setComponent('field_test_text', [
         'type' => 'text_textfield',
         'weight' => 0,
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php
index de6cef999c..5c9fc23ee6 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php
@@ -191,7 +191,9 @@ protected function setupTestFields() {
       'bundle' => $this->bundle,
       'label' => 'Test translatable text-field',
     ])->save();
-    entity_get_form_display($this->entityTypeId, $this->bundle, 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay($this->entityTypeId, $this->bundle, 'default')
       ->setComponent($this->fieldName, [
         'type' => 'string_textfield',
         'weight' => 0,
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php
index 300c17c7ca..3d7acfd6d8 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php
@@ -58,7 +58,7 @@ protected function setupTestFields() {
       'label' => 'Untranslatable-but-visible test field',
       'translatable' => FALSE,
     ])->save();
-    entity_get_form_display($this->entityTypeId, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay($this->entityTypeId, $this->bundle, 'default')
       ->setComponent('field_multilingual', [
         'type' => 'test_field_widget_multilingual',
       ])
diff --git a/core/modules/datetime/src/Tests/DateTestBase.php b/core/modules/datetime/src/Tests/DateTestBase.php
index 6a89003900..87a7e9613b 100644
--- a/core/modules/datetime/src/Tests/DateTestBase.php
+++ b/core/modules/datetime/src/Tests/DateTestBase.php
@@ -28,9 +28,14 @@
   public static $modules = ['node', 'entity_test', 'datetime', 'field_ui'];
 
   /**
-   * An array of display options to pass to entity_get_display()
+   * An array of display options.
+   *
+   * An array of display options to pass to
+   * EntityDisplayRepositoryInterface::getViewDisplay()
    *
    * @var array
+   *
+   * @see \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewDisplay()
    */
   protected $displayOptions;
 
diff --git a/core/modules/datetime/tests/src/Functional/DateTestBase.php b/core/modules/datetime/tests/src/Functional/DateTestBase.php
index 46e23ce150..fffeabdad2 100644
--- a/core/modules/datetime/tests/src/Functional/DateTestBase.php
+++ b/core/modules/datetime/tests/src/Functional/DateTestBase.php
@@ -24,9 +24,14 @@
   public static $modules = ['node', 'entity_test', 'datetime', 'field_ui'];
 
   /**
-   * An array of display options to pass to entity_get_display()
+   * An array of display options.
+   *
+   * An array of display options to pass to
+   * EntityDisplayRepositoryInterface::getViewDisplay()
    *
    * @var array
+   *
+   * @see \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewDisplay()
    */
   protected $displayOptions;
 
diff --git a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
index 792e75bef0..8fb74628e7 100644
--- a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
@@ -38,6 +38,8 @@ protected function getTestFieldType() {
   public function testDateField() {
     $field_name = $this->fieldStorage->getName();
 
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Loop through defined timezones to test that date-only fields work at the
     // extremes.
     foreach (static::$timezones as $timezone) {
@@ -104,7 +106,8 @@ public function testDateField() {
         foreach ($values as $new_value) {
           // Update the entity display settings.
           $this->displayOptions['settings'] = [$setting => $new_value] + $this->defaultSettings;
-          entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+          $this->container->get('entity_display.repository')
+            ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
             ->setComponent($field_name, $this->displayOptions)
             ->save();
 
@@ -133,7 +136,8 @@ public function testDateField() {
       // Verify that the plain formatter works.
       $this->displayOptions['type'] = 'datetime_plain';
       $this->displayOptions['settings'] = $this->defaultSettings;
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository
+        ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = $date->format(DateTimeItemInterface::DATE_STORAGE_FORMAT);
@@ -146,7 +150,8 @@ public function testDateField() {
       // Verify that the 'datetime_custom' formatter works.
       $this->displayOptions['type'] = 'datetime_custom';
       $this->displayOptions['settings'] = ['date_format' => 'm/d/Y'] + $this->defaultSettings;
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository
+        ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = $date->format($this->displayOptions['settings']['date_format']);
@@ -159,7 +164,7 @@ public function testDateField() {
       // Test that allowed markup in custom format is preserved and XSS is
       // removed.
       $this->displayOptions['settings']['date_format'] = '\\<\\s\\t\\r\\o\\n\\g\\>m/d/Y\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\c\\r\\i\\p\\t\\>\\a\\l\\e\\r\\t\\(\\S\\t\\r\\i\\n\\g\\.\\f\\r\\o\\m\\C\\h\\a\\r\\C\\o\\d\\e\\(\\8\\8\\,\\8\\3\\,\\8\\3\\)\\)\\<\\/\\s\\c\\r\\i\\p\\t\\>';
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = '<strong>' . $date->format('m/d/Y') . '</strong>alert(String.fromCharCode(88,83,83))';
@@ -187,7 +192,7 @@ public function testDateField() {
         'past_format' => '@interval in the past',
         'granularity' => 3,
       ];
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = new FormattableMarkup($this->displayOptions['settings']['past_format'], [
@@ -211,7 +216,7 @@ public function testDateField() {
       $entity->{$field_name}->value = $date->format($date_format);
       $entity->save();
 
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = new FormattableMarkup($this->displayOptions['settings']['future_format'], [
@@ -265,6 +270,9 @@ public function testDatetimeField() {
     $this->assertRaw($date->format($date_format));
     $this->assertRaw($date->format($time_format));
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Verify that the date is output according to the formatter settings.
     $options = [
       'format_type' => ['short', 'medium', 'long'],
@@ -273,7 +281,7 @@ public function testDatetimeField() {
       foreach ($values as $new_value) {
         // Update the entity display settings.
         $this->displayOptions['settings'] = [$setting => $new_value] + $this->defaultSettings;
-        entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+        $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
           ->setComponent($field_name, $this->displayOptions)
           ->save();
 
@@ -295,7 +303,8 @@ public function testDatetimeField() {
     // Verify that the plain formatter works.
     $this->displayOptions['type'] = 'datetime_plain';
     $this->displayOptions['settings'] = $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository
+      ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
@@ -305,7 +314,7 @@ public function testDatetimeField() {
     // Verify that the 'datetime_custom' formatter works.
     $this->displayOptions['type'] = 'datetime_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $date->format($this->displayOptions['settings']['date_format']);
@@ -315,7 +324,7 @@ public function testDatetimeField() {
     // Verify that the 'timezone_override' setting works.
     $this->displayOptions['type'] = 'datetime_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A', 'timezone_override' => 'America/New_York'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $date->format($this->displayOptions['settings']['date_format'], ['timezone' => 'America/New_York']);
@@ -340,7 +349,7 @@ public function testDatetimeField() {
       'past_format' => '@interval earlier',
       'granularity' => 3,
     ];
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = new FormattableMarkup($this->displayOptions['settings']['past_format'], [
@@ -361,7 +370,8 @@ public function testDatetimeField() {
     $entity->{$field_name}->value = $date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
     $entity->save();
 
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository
+      ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = new FormattableMarkup($this->displayOptions['settings']['future_format'], [
@@ -382,8 +392,11 @@ public function testDatelistWidget() {
     $this->fieldStorage->setSetting('datetime_type', 'date');
     $this->fieldStorage->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Change the widget to a datelist widget.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'datetime_datelist',
         'settings' => [
@@ -417,7 +430,7 @@ public function testDatelistWidget() {
     $this->fieldStorage->save();
 
     // Change the widget to a datelist widget.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'datetime_datelist',
         'settings' => [
@@ -483,7 +496,7 @@ public function testDatelistWidget() {
     $this->assertOptionSelected("edit-$field_name-0-value-ampm", 'am', 'Correct ampm selected.');
 
     // Test the widget using increment other than 1 and 24 hour mode.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'datetime_datelist',
         'settings' => [
@@ -523,7 +536,7 @@ public function testDatelistWidget() {
     $this->assertOptionSelected("edit-$field_name-0-value-minute", '15', 'Correct minute selected.');
 
     // Test the widget for partial completion of fields.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'datetime_datelist',
         'settings' => [
@@ -873,7 +886,8 @@ public function testDateStorageSettings() {
     ]);
     $field->save();
 
-    entity_get_form_display('node', 'date_content', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'date_content')
       ->setComponent($field_name, [
         'type' => 'datetime_default',
       ])
diff --git a/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php b/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php
index 2aa9c5fbb8..d143413cbb 100644
--- a/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php
@@ -16,7 +16,7 @@
 class DateTimeTimeAgoFormatterTest extends BrowserTestBase {
 
   /**
-   * An array of display options to pass to entity_get_display().
+   * An array of field formatter display options.
    *
    * @var array
    */
diff --git a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
index 9cecd605f0..4343a050ae 100644
--- a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
+++ b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
@@ -123,8 +123,11 @@ public function testDateRangeField() {
         ] + $this->defaultSettings,
       ];
 
+      /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+      $display_repository = \Drupal::service('entity_display.repository');
+
       // Verify that the default formatter works.
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
 
@@ -157,7 +160,8 @@ public function testDateRangeField() {
       // Verify that the plain formatter works.
       $this->displayOptions['type'] = 'daterange_plain';
       $this->displayOptions['settings'] = $this->defaultSettings;
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $this->container->get('entity_display.repository')
+        ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = $start_date->format(DateTimeItemInterface::DATE_STORAGE_FORMAT) . ' - ' . $end_date->format(DateTimeItemInterface::DATE_STORAGE_FORMAT);
@@ -170,7 +174,7 @@ public function testDateRangeField() {
       // Verify that the custom formatter works.
       $this->displayOptions['type'] = 'daterange_custom';
       $this->displayOptions['settings'] = ['date_format' => 'm/d/Y'] + $this->defaultSettings;
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' - ' . $end_date->format($this->displayOptions['settings']['date_format']);
@@ -183,7 +187,7 @@ public function testDateRangeField() {
       // Test that allowed markup in custom format is preserved and XSS is
       // removed.
       $this->displayOptions['settings']['date_format'] = '\\<\\s\\t\\r\\o\\n\\g\\>m/d/Y\\<\\/\\s\\t\\r\\o\\n\\g\\>\\<\\s\\c\\r\\i\\p\\t\\>\\a\\l\\e\\r\\t\\(\\S\\t\\r\\i\\n\\g\\.\\f\\r\\o\\m\\C\\h\\a\\r\\C\\o\\d\\e\\(\\8\\8\\,\\8\\3\\,\\8\\3\\)\\)\\<\\/\\s\\c\\r\\i\\p\\t\\>';
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = '<strong>' . $start_date->format('m/d/Y') . '</strong>alert(String.fromCharCode(88,83,83)) - <strong>' . $end_date->format('m/d/Y') . '</strong>alert(String.fromCharCode(88,83,83))';
@@ -222,7 +226,7 @@ public function testDateRangeField() {
           ] + $this->defaultSettings,
       ];
 
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
 
@@ -245,7 +249,8 @@ public function testDateRangeField() {
 
       $this->displayOptions['type'] = 'daterange_plain';
       $this->displayOptions['settings'] = $this->defaultSettings;
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $this->container->get('entity_display.repository')
+        ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = $start_date->format(DateTimeItemInterface::DATE_STORAGE_FORMAT);
@@ -258,7 +263,7 @@ public function testDateRangeField() {
 
       $this->displayOptions['type'] = 'daterange_custom';
       $this->displayOptions['settings'] = ['date_format' => 'm/d/Y'] + $this->defaultSettings;
-      entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+      $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
         ->setComponent($field_name, $this->displayOptions)
         ->save();
       $expected = $start_date->format($this->displayOptions['settings']['date_format']);
@@ -321,12 +326,15 @@ public function testDatetimeRangeField() {
     $this->assertRaw($end_date->format($date_format));
     $this->assertRaw($end_date->format($time_format));
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Verify that the default formatter works.
     $this->displayOptions['settings'] = [
       'format_type' => 'long',
       'separator' => 'THESEPARATOR',
     ] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
 
@@ -349,7 +357,8 @@ public function testDatetimeRangeField() {
     // Verify that the plain formatter works.
     $this->displayOptions['type'] = 'daterange_plain';
     $this->displayOptions['settings'] = $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $this->container->get('entity_display.repository')
+      ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT) . ' - ' . $end_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
@@ -359,7 +368,7 @@ public function testDatetimeRangeField() {
     // Verify that the 'datetime_custom' formatter works.
     $this->displayOptions['type'] = 'daterange_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' - ' . $end_date->format($this->displayOptions['settings']['date_format']);
@@ -369,7 +378,7 @@ public function testDatetimeRangeField() {
     // Verify that the 'timezone_override' setting works.
     $this->displayOptions['type'] = 'daterange_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A', 'timezone_override' => 'America/New_York'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format($this->displayOptions['settings']['date_format'], ['timezone' => 'America/New_York']);
@@ -407,7 +416,7 @@ public function testDatetimeRangeField() {
       ] + $this->defaultSettings,
     ];
 
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
 
@@ -425,7 +434,8 @@ public function testDatetimeRangeField() {
 
     $this->displayOptions['type'] = 'daterange_plain';
     $this->displayOptions['settings'] = $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $this->container->get('entity_display.repository')
+      ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
@@ -435,7 +445,7 @@ public function testDatetimeRangeField() {
 
     $this->displayOptions['type'] = 'daterange_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format($this->displayOptions['settings']['date_format']);
@@ -489,12 +499,15 @@ public function testAlldayRangeField() {
     $this->assertRaw($end_date->format($date_format));
     $this->assertNoRaw($end_date->format($time_format));
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Verify that the default formatter works.
     $this->displayOptions['settings'] = [
       'format_type' => 'long',
       'separator' => 'THESEPARATOR',
     ] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
 
@@ -517,7 +530,8 @@ public function testAlldayRangeField() {
     // Verify that the plain formatter works.
     $this->displayOptions['type'] = 'daterange_plain';
     $this->displayOptions['settings'] = $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $this->container->get('entity_display.repository')
+      ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT) . ' - ' . $end_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
@@ -527,7 +541,7 @@ public function testAlldayRangeField() {
     // Verify that the custom formatter works.
     $this->displayOptions['type'] = 'daterange_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' - ' . $end_date->format($this->displayOptions['settings']['date_format']);
@@ -537,7 +551,7 @@ public function testAlldayRangeField() {
     // Verify that the 'timezone_override' setting works.
     $this->displayOptions['type'] = 'daterange_custom';
     $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A', 'timezone_override' => 'America/New_York'] + $this->defaultSettings;
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format($this->displayOptions['settings']['date_format'], ['timezone' => 'America/New_York']);
@@ -574,7 +588,7 @@ public function testAlldayRangeField() {
       ] + $this->defaultSettings,
     ];
 
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
 
@@ -595,7 +609,8 @@ public function testAlldayRangeField() {
     $this->assertFieldByXPath('//div[@data-field-item-attr="foobar"]');
 
     $this->displayOptions['type'] = 'daterange_plain';
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $this->container->get('entity_display.repository')
+      ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT) . ' THESEPARATOR ' . $end_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);
@@ -605,7 +620,7 @@ public function testAlldayRangeField() {
 
     $this->displayOptions['type'] = 'daterange_custom';
     $this->displayOptions['settings']['date_format'] = 'm/d/Y';
-    entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
+    $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full')
       ->setComponent($field_name, $this->displayOptions)
       ->save();
     $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' THESEPARATOR ' . $end_date->format($this->displayOptions['settings']['date_format']);
@@ -626,8 +641,11 @@ public function testDatelistWidget() {
     $this->fieldStorage->setSetting('datetime_type', DateRangeItem::DATETIME_TYPE_DATE);
     $this->fieldStorage->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Change the widget to a datelist widget.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'daterange_datelist',
         'settings' => [
@@ -664,7 +682,7 @@ public function testDatelistWidget() {
     $this->fieldStorage->save();
 
     // Change the widget to a datelist widget.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'daterange_datelist',
         'settings' => [
@@ -698,7 +716,7 @@ public function testDatelistWidget() {
     $this->fieldStorage->save();
 
     // Change the widget to a datelist widget.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'daterange_datelist',
         'settings' => [
@@ -764,7 +782,7 @@ public function testDatelistWidget() {
     $this->assertOptionSelected("edit-$field_name-0-end-value-ampm", 'pm', 'Correct ampm selected.');
 
     // Test the widget using increment other than 1 and 24 hour mode.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'daterange_datelist',
         'settings' => [
@@ -817,7 +835,7 @@ public function testDatelistWidget() {
     $this->assertOptionSelected("edit-$field_name-0-end-value-minute", '30', 'Correct minute selected.');
 
     // Test the widget for partial completion of fields.
-    entity_get_form_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'default')
+    $display_repository->getFormDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle())
       ->setComponent($field_name, [
         'type' => 'daterange_datelist',
         'settings' => [
@@ -1104,7 +1122,8 @@ public function testDefaultValue() {
     $this->assertNull($new_node->get($field_name)->value, 'Default value is not set');
 
     // Set now as default_value for start date only.
-    entity_get_form_display('node', 'date_content', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'date_content')
       ->setComponent($field_name, [
         'type' => 'datetime_default',
       ])
@@ -1360,7 +1379,8 @@ public function testDateStorageSettings() {
     ]);
     $field->save();
 
-    entity_get_form_display('node', 'date_content', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'date_content')
       ->setComponent($field_name, [
         'type' => 'datetime_default',
       ])
diff --git a/core/modules/editor/tests/src/Functional/EditorLoadingTest.php b/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
index 3892fdff78..0a10605da6 100644
--- a/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
@@ -94,7 +94,8 @@ protected function setUp() {
       'bundle' => 'page',
     ])->save();
 
-    entity_get_form_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'page')
       ->setComponent('field_text')
       ->save();
 
diff --git a/core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php b/core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php
index 1801cc8482..4131cefd45 100644
--- a/core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php
+++ b/core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php
@@ -125,7 +125,9 @@ protected function getSelectedEditor($entity_id, $field_name, $view_mode = 'defa
     $storage->resetCache([$entity_id]);
     $entity = $storage->load($entity_id);
     $items = $entity->get($field_name);
-    $options = entity_get_display('entity_test', 'entity_test', $view_mode)->getComponent($field_name);
+    $options = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test', $view_mode)
+      ->getComponent($field_name);
     return $this->editorSelector->getEditor($options['type'], $items);
   }
 
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
index b1d7ab5298..5d85c65465 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
@@ -83,14 +83,17 @@ public function testBooleanField() {
     ]);
     $this->field->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Create a form display for the default form mode.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'boolean_checkbox',
       ])
       ->save();
     // Create a display for the full view mode.
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, [
         'type' => 'boolean',
       ])
@@ -117,7 +120,7 @@ public function testBooleanField() {
     $this->assertRaw('<div class="field__item">' . $on . '</div>');
 
     // Test with "On" label option.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'boolean_checkbox',
         'settings' => [
@@ -203,15 +206,18 @@ public function testFormAccess() {
     ]);
     $this->field->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Create a form display for the default form mode.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'boolean_checkbox',
       ])
       ->save();
 
     // Create a display for the full view mode.
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, [
         'type' => 'boolean',
       ])
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
index 0dadce9046..af92c3f735 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
@@ -64,12 +64,13 @@ protected function setUp() {
     ]);
     $instance->save();
 
-    $display = entity_get_display('node', $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'boolean',
         'settings' => [],
-      ]);
-    $display->save();
+      ])
+      ->save();
   }
 
   /**
diff --git a/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php b/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
index 76a167d117..3fb80a85d4 100644
--- a/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
@@ -63,8 +63,11 @@ public function testEmailField() {
     ]);
     $this->field->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Create a form display for the default form mode.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'email_default',
         'settings' => [
@@ -73,7 +76,7 @@ public function testEmailField() {
       ])
       ->save();
     // Create a display for the full view mode.
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, [
         'type' => 'email_mailto',
       ])
@@ -97,7 +100,7 @@ public function testEmailField() {
 
     // Verify that a mailto link is displayed.
     $entity = EntityTest::load($id);
-    $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
+    $display = $display_repository->getViewDisplay($entity->getEntityTypeId(), $entity->bundle(), 'full');
     $content = $display->build($entity);
     $rendered_content = (string) \Drupal::service('renderer')->renderRoot($content);
     $this->assertContains('href="mailto:test@example.com"', $rendered_content);
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
index 2e1fabdd53..9c7b9b46c3 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
@@ -75,10 +75,13 @@ protected function setUp() {
       ],
     ])->save();
 
-    entity_get_display('node', $referencing->id(), 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getViewDisplay('node', $referencing->id())
       ->setComponent('test_field')
       ->save();
-    entity_get_form_display('node', $referencing->id(), 'default')
+    $display_repository->getFormDisplay('node', $referencing->id(), 'default')
       ->setComponent('test_field', [
         'type' => 'entity_reference_autocomplete',
       ])
@@ -166,7 +169,8 @@ public function testMultipleTargetBundles() {
     ];
     $this->createEntityReferenceField('node', $this->referencingType, $field_name, $this->randomString(), 'taxonomy_term', 'default', $handler_settings);
     /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $fd */
-    entity_get_form_display('node', $this->referencingType, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', $this->referencingType)
       ->setComponent($field_name, ['type' => 'entity_reference_autocomplete'])
       ->save();
 
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 56945d962d..6771270961 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -251,12 +251,16 @@ protected function setUpEntityReferenceField() {
       'entity_type' => $this->testEntityTypeName,
     ])
       ->save();
-    entity_get_form_display($this->testEntityTypeName, $this->referrerType->id(), 'default')
+
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay($this->testEntityTypeName, $this->referrerType->id())
       ->setComponent($this->referenceFieldName, [
         'type' => 'entity_reference_autocomplete',
       ])
       ->save();
-    entity_get_display($this->testEntityTypeName, $this->referrerType->id(), 'default')
+    $display_repository->getViewDisplay($this->testEntityTypeName, $this->referrerType->id())
       ->setComponent($this->referenceFieldName, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
index 792f43576d..7892aa8671 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
@@ -95,11 +95,14 @@ protected function setUp() {
       'label' => $this->randomMachineName() . '_label',
     ])->save();
 
-    entity_get_display('node', $referencing->id(), 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getViewDisplay('node', $referencing->id())
       ->setComponent('test_field')
       ->setComponent($file_field_name)
       ->save();
-    entity_get_form_display('node', $referencing->id(), 'default')
+    $display_repository->getFormDisplay('node', $referencing->id())
       ->setComponent('test_field', [
         'type' => 'entity_reference_autocomplete',
       ])
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
index 15326b9952..40d0bfa472 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
@@ -68,8 +68,13 @@ public function testSupportedEntityTypesAndWidgets() {
       // Create an Entity reference field.
       $this->createEntityReferenceField($this->entityType, $this->bundle, $this->fieldName, $this->fieldName, $referenced_entities[0]->getEntityTypeId(), 'default', [], 2);
 
+      /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+      $display_repository = \Drupal::service('entity_display.repository');
+
       // Test the default 'entity_reference_autocomplete' widget.
-      entity_get_form_display($this->entityType, $this->bundle, 'default')->setComponent($this->fieldName)->save();
+      $display_repository->getFormDisplay($this->entityType, $this->bundle)
+        ->setComponent($this->fieldName)
+        ->save();
 
       $entity_name = $this->randomMachineName();
       $edit = [
@@ -94,9 +99,10 @@ public function testSupportedEntityTypesAndWidgets() {
       $this->assertFieldValues($entity_name, $referenced_entities);
 
       // Test the 'entity_reference_autocomplete_tags' widget.
-      entity_get_form_display($this->entityType, $this->bundle, 'default')->setComponent($this->fieldName, [
-        'type' => 'entity_reference_autocomplete_tags',
-      ])->save();
+      $display_repository->getFormDisplay($this->entityType, $this->bundle)
+        ->setComponent($this->fieldName, [
+          'type' => 'entity_reference_autocomplete_tags',
+        ])->save();
 
       $entity_name = $this->randomMachineName();
       $target_id = $referenced_entities[0]->label() . ' (' . $referenced_entities[0]->id() . ')';
@@ -127,16 +133,19 @@ public function testSupportedEntityTypesAndWidgets() {
       $supported_widget_types = array_diff(array_keys($supported_widgets), $exclude);
 
       foreach ($supported_widget_types as $widget_type) {
-        entity_get_form_display($this->entityType, $this->bundle, 'default')->setComponent($this->fieldName, [
-          'type' => $widget_type,
-        ])->save();
+        $display_repository->getFormDisplay($this->entityType, $this->bundle)
+          ->setComponent($this->fieldName, [
+            'type' => $widget_type,
+          ])->save();
 
         $this->drupalPostForm($this->entityType . '/manage/' . $entity->id() . '/edit', [], t('Save'));
         $this->assertFieldValues($entity_name, $referenced_entities);
       }
 
       // Reset to the default 'entity_reference_autocomplete' widget.
-      entity_get_form_display($this->entityType, $this->bundle, 'default')->setComponent($this->fieldName)->save();
+      $display_repository->getFormDisplay($this->entityType, $this->bundle)
+        ->setComponent($this->fieldName)
+        ->save();
 
       // Set first entity as the default_value.
       $field_edit = [
diff --git a/core/modules/field/tests/src/Functional/FieldAccessTest.php b/core/modules/field/tests/src/Functional/FieldAccessTest.php
index c7f234fd49..55a2812abe 100644
--- a/core/modules/field/tests/src/Functional/FieldAccessTest.php
+++ b/core/modules/field/tests/src/Functional/FieldAccessTest.php
@@ -58,7 +58,8 @@ protected function setUp() {
 
     // Assign display properties for the 'default' and 'teaser' view modes.
     foreach (['default', 'teaser'] as $view_mode) {
-      entity_get_display('node', $content_type, $view_mode)
+      \Drupal::service('entity_display.repository')
+        ->getViewDisplay('node', $content_type, $view_mode)
         ->setComponent($field_storage['field_name'])
         ->save();
     }
diff --git a/core/modules/field/tests/src/Functional/FormTest.php b/core/modules/field/tests/src/Functional/FormTest.php
index 95efcb49bd..5522e0205f 100644
--- a/core/modules/field/tests/src/Functional/FormTest.php
+++ b/core/modules/field/tests/src/Functional/FormTest.php
@@ -97,7 +97,8 @@ public function testFieldFormSingle() {
     $this->field['field_name'] = $field_name;
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($field_name)
       ->save();
 
@@ -176,7 +177,8 @@ public function testFieldFormDefaultValue() {
     $this->field['default_value'] = [['value' => $default]];
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($field_name)
       ->save();
 
@@ -204,7 +206,8 @@ public function testFieldFormSingleRequired() {
     $this->field['required'] = TRUE;
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($field_name)
       ->save();
 
@@ -240,7 +243,8 @@ public function testFieldFormUnlimited() {
     $this->field['field_name'] = $field_name;
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($field_name)
       ->save();
 
@@ -326,7 +330,8 @@ public function testFieldFormUnlimitedRequired() {
     $this->field['required'] = TRUE;
     FieldStorageConfig::create($this->fieldStorageUnlimited)->save();
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($field_name)
       ->save();
 
@@ -345,13 +350,16 @@ public function testFieldFormUnlimitedRequired() {
    * Tests widget handling of multiple required radios.
    */
   public function testFieldFormMultivalueWithRequiredRadio() {
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Create a multivalue test field.
     $field_storage = $this->fieldStorageUnlimited;
     $field_name = $field_storage['field_name'];
     $this->field['field_name'] = $field_name;
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    $display_repository->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($field_name)
       ->save();
 
@@ -371,7 +379,7 @@ public function testFieldFormMultivalueWithRequiredRadio() {
       'required' => TRUE,
     ];
     FieldConfig::create($field)->save();
-    entity_get_form_display($field['entity_type'], $field['bundle'], 'default')
+    $display_repository->getFormDisplay($field['entity_type'], $field['bundle'])
       ->setComponent($field['field_name'], [
         'type' => 'options_buttons',
       ])
@@ -403,7 +411,7 @@ public function testFieldFormMultipleWidget() {
     $this->field['field_name'] = $field_name;
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($this->field)->save();
-    $form = entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    $form = \Drupal::service('entity_display.repository')->getFormDisplay($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name, [
         'type' => 'test_field_widget_multiple',
       ]);
@@ -452,6 +460,9 @@ public function testFieldFormMultipleWidget() {
    * Tests fields with no 'edit' access.
    */
   public function testFieldFormAccess() {
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     $entity_type = 'entity_test_rev';
     // Create a "regular" field.
     $field_storage = $this->fieldStorageSingle;
@@ -463,7 +474,7 @@ public function testFieldFormAccess() {
     $field['bundle'] = $entity_type;
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($field)->save();
-    entity_get_form_display($entity_type, $entity_type, 'default')
+    $display_repository->getFormDisplay($entity_type, $entity_type)
       ->setComponent($field_name)
       ->save();
 
@@ -483,7 +494,7 @@ public function testFieldFormAccess() {
     ];
     FieldStorageConfig::create($field_storage_no_access)->save();
     FieldConfig::create($field_no_access)->save();
-    entity_get_form_display($field_no_access['entity_type'], $field_no_access['bundle'], 'default')
+    $display_repository->getFormDisplay($field_no_access['entity_type'], $field_no_access['bundle'])
       ->setComponent($field_name_no_access)
       ->save();
 
@@ -493,7 +504,7 @@ public function testFieldFormAccess() {
       ->getStorage($entity_type)
       ->create(['id' => 0, 'revision_id' => 0]);
 
-    $display = entity_get_form_display($entity_type, $entity_type, 'default');
+    $display = $display_repository->getFormDisplay($entity_type, $entity_type);
     $form = [];
     $form_state = new FormState();
     $display->buildForm($entity, $form, $form_state);
@@ -578,7 +589,8 @@ public function testHiddenField() {
     // widget.
     $this->field->setDefaultValue([]);
     $this->field->save();
-    entity_get_form_display($entity_type, $this->field->getTargetBundle(), 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $this->field->getTargetBundle())
       ->setComponent($this->field->getName(), [
         'type' => 'test_field_widget',
       ])
@@ -598,7 +610,8 @@ public function testHiddenField() {
     $this->assertEqual($entity->{$field_name}->value, $value, 'Field value was updated');
 
     // Set the field back to hidden.
-    entity_get_form_display($entity_type, $this->field->getTargetBundle(), 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $this->field->getTargetBundle())
       ->removeComponent($this->field->getName())
       ->save();
 
@@ -694,7 +707,7 @@ protected function widgetAlterTest($hook, $widget) {
       'field_name' => $field_name,
       'widget' => $widget,
     ]);
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name, [
         'type' => $widget,
       ])
diff --git a/core/modules/field/tests/src/Functional/NestedFormTest.php b/core/modules/field/tests/src/Functional/NestedFormTest.php
index bea6c51269..6ae583ff85 100644
--- a/core/modules/field/tests/src/Functional/NestedFormTest.php
+++ b/core/modules/field/tests/src/Functional/NestedFormTest.php
@@ -54,19 +54,22 @@ protected function setUp() {
    * Tests Field API form integration within a subform.
    */
   public function testNestedFieldForm() {
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Add two fields on the 'entity_test'
     FieldStorageConfig::create($this->fieldStorageSingle)->save();
     FieldStorageConfig::create($this->fieldStorageUnlimited)->save();
     $this->field['field_name'] = 'field_single';
     $this->field['label'] = 'Single field';
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    $display_repository->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($this->field['field_name'])
       ->save();
     $this->field['field_name'] = 'field_unlimited';
     $this->field['label'] = 'Unlimited field';
     FieldConfig::create($this->field)->save();
-    entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
+    $display_repository->getFormDisplay($this->field['entity_type'], $this->field['bundle'])
       ->setComponent($this->field['field_name'])
       ->save();
 
diff --git a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
index c5f2bbe9f7..347b72c419 100644
--- a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
@@ -51,7 +51,10 @@ public function testNumberDecimalField() {
       'bundle' => 'entity_test',
     ])->save();
 
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number',
         'settings' => [
@@ -59,7 +62,7 @@ public function testNumberDecimalField() {
         ],
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'default')
+    $display_repository->getViewDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number_decimal',
       ])
@@ -145,7 +148,10 @@ public function testNumberIntegerField() {
       ],
     ])->save();
 
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number',
         'settings' => [
@@ -153,7 +159,7 @@ public function testNumberIntegerField() {
         ],
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'default')
+    $display_repository->getViewDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number_integer',
         'settings' => [
@@ -245,7 +251,7 @@ public function testNumberIntegerField() {
     }
 
     // Test for the content attribute when a Prefix is displayed. Presumably this also tests for the attribute when a Suffix is displayed.
-    entity_get_display('entity_test', 'entity_test', 'default')
+    $display_repository->getViewDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number_integer',
         'settings' => [
@@ -284,7 +290,10 @@ public function testNumberFloatField() {
       'bundle' => 'entity_test',
     ])->save();
 
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number',
         'settings' => [
@@ -293,7 +302,7 @@ public function testNumberFloatField() {
       ])
       ->save();
 
-    entity_get_display('entity_test', 'entity_test', 'default')
+    $display_repository->getViewDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'number_decimal',
       ])
diff --git a/core/modules/field/tests/src/Functional/String/StringFieldTest.php b/core/modules/field/tests/src/Functional/String/StringFieldTest.php
index e9894f8103..e3419be349 100644
--- a/core/modules/field/tests/src/Functional/String/StringFieldTest.php
+++ b/core/modules/field/tests/src/Functional/String/StringFieldTest.php
@@ -62,7 +62,11 @@ public function _testTextfieldWidgets($field_type, $widget_type) {
       'bundle' => 'entity_test',
       'label' => $this->randomMachineName() . '_label',
     ])->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => $widget_type,
         'settings' => [
@@ -70,7 +74,7 @@ public function _testTextfieldWidgets($field_type, $widget_type) {
         ],
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name)
       ->save();
 
@@ -92,7 +96,7 @@ public function _testTextfieldWidgets($field_type, $widget_type) {
 
     // Display the entity.
     $entity = EntityTest::load($id);
-    $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
+    $display = $display_repository->getViewDisplay($entity->getEntityTypeId(), $entity->bundle(), 'full');
     $content = $display->build($entity);
     $rendered_entity = \Drupal::service('renderer')->renderRoot($content);
     $this->assertContains($value, (string) $rendered_entity);
diff --git a/core/modules/field/tests/src/Functional/TranslationWebTest.php b/core/modules/field/tests/src/Functional/TranslationWebTest.php
index 465add964d..f8674fb3e3 100644
--- a/core/modules/field/tests/src/Functional/TranslationWebTest.php
+++ b/core/modules/field/tests/src/Functional/TranslationWebTest.php
@@ -69,7 +69,8 @@ protected function setUp() {
     FieldConfig::create($field)->save();
     $this->field = FieldConfig::load($this->entityTypeId . '.' . $field['bundle'] . '.' . $this->fieldName);
 
-    entity_get_form_display($this->entityTypeId, $this->entityTypeId, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->entityTypeId, $this->entityTypeId)
       ->setComponent($this->fieldName)
       ->save();
 
diff --git a/core/modules/field/tests/src/Functional/reEnableModuleFieldTest.php b/core/modules/field/tests/src/Functional/reEnableModuleFieldTest.php
index 59aaf22905..046bbb566e 100644
--- a/core/modules/field/tests/src/Functional/reEnableModuleFieldTest.php
+++ b/core/modules/field/tests/src/Functional/reEnableModuleFieldTest.php
@@ -45,7 +45,6 @@ protected function setUp() {
    * @see field_system_info_alter()
    */
   public function testReEnabledField() {
-
     // Add a telephone field to the article content type.
     $field_storage = FieldStorageConfig::create([
       'field_name' => 'field_telephone',
@@ -59,7 +58,9 @@ public function testReEnabledField() {
       'label' => 'Telephone Number',
     ])->save();
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent('field_telephone', [
         'type' => 'telephone_default',
         'settings' => [
@@ -68,7 +69,7 @@ public function testReEnabledField() {
       ])
       ->save();
 
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent('field_telephone', [
         'type' => 'telephone_link',
         'weight' => 1,
diff --git a/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
index 7837536e27..b6224c0e20 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
@@ -71,7 +71,7 @@ protected function setUp() {
     ]);
     $instance->save();
 
-    $display = entity_get_display('node', $this->bundle, 'default')
+    $display = \Drupal::service('entity_display.repository')->getViewDisplay('node', $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'boolean',
         'settings' => [],
diff --git a/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php b/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
index 02481275f0..e649e72eeb 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
@@ -86,7 +86,7 @@ public function testNumberFormatter() {
       ],
     ])->save();
 
-    entity_get_form_display('node', $type, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', $type, 'default')
       ->setComponent($float_field, [
         'type' => 'number',
         'settings' => [
@@ -101,7 +101,7 @@ public function testNumberFormatter() {
       ])
       ->save();
 
-    entity_get_display('node', $type, 'default')
+    \Drupal::service('entity_display.repository')->getViewDisplay('node', $type)
       ->setComponent($float_field, [
         'type' => 'number_decimal',
       ])
@@ -150,7 +150,7 @@ public function testNumberFormatter() {
     $this->assertRaw((string) $random_integer);
 
     // Configure the number_decimal formatter.
-    entity_get_display('node', $type, 'default')
+    \Drupal::service('entity_display.repository')->getViewDisplay('node', $type)
       ->setComponent($integer_field, [
         'type' => 'number_integer',
       ])
diff --git a/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php b/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
index b2fb19384c..7237e5d354 100644
--- a/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
@@ -70,7 +70,8 @@ protected function setUp() {
     ]);
     $instance->save();
 
-    $this->display = entity_get_display($this->entityType, $this->bundle, 'default')
+    $this->display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'boolean',
         'settings' => [],
diff --git a/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php b/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
index 37acab86c2..18f6c34e2c 100644
--- a/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
@@ -35,7 +35,8 @@ protected function setUp() {
     ])->save();
 
     // Create a form display for the default form mode.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent('field_boolean', [
         'type' => 'boolean_checkbox',
       ])
diff --git a/core/modules/field/tests/src/Kernel/DisplayApiTest.php b/core/modules/field/tests/src/Kernel/DisplayApiTest.php
index 0afb23700c..df81f48d3e 100644
--- a/core/modules/field/tests/src/Kernel/DisplayApiTest.php
+++ b/core/modules/field/tests/src/Kernel/DisplayApiTest.php
@@ -97,15 +97,18 @@ protected function setUp() {
       ],
     ];
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     FieldStorageConfig::create($field_storage)->save();
     FieldConfig::create($field)->save();
     // Create a display for the default view mode.
-    entity_get_display($field['entity_type'], $field['bundle'], 'default')
+    $display_repository->getViewDisplay($field['entity_type'], $field['bundle'])
       ->setComponent($this->fieldName, $this->displayOptions['default'])
       ->save();
     // Create a display for the teaser view mode.
     EntityViewMode::create(['id' => 'entity_test.teaser', 'targetEntityType' => 'entity_test'])->save();
-    entity_get_display($field['entity_type'], $field['bundle'], 'teaser')
+    $display_repository->getViewDisplay($field['entity_type'], $field['bundle'], 'teaser')
       ->setComponent($this->fieldName, $this->displayOptions['teaser'])
       ->save();
 
diff --git a/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php b/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php
index 10b44333e0..df971fb0d6 100644
--- a/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php
@@ -32,7 +32,8 @@ protected function setUp() {
     ])->save();
 
     // Create a form display for the default form mode.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent('field_email', [
         'type' => 'email_default',
       ])
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
index e7558803ed..b84286ec5d 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
@@ -92,7 +92,8 @@ protected function setUp() {
       'field_name' => 'body',
       'label' => 'Body',
     ])->save();
-    entity_get_display($this->entityType, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent('body', [
         'type' => 'text_default',
         'settings' => [],
@@ -149,7 +150,8 @@ public function testAccess() {
     // Get all the existing formatters.
     foreach ($formatter_manager->getOptions('entity_reference') as $formatter => $name) {
       // Set formatter type for the 'full' view mode.
-      entity_get_display($this->entityType, $this->bundle, 'default')
+      \Drupal::service('entity_display.repository')
+        ->getViewDisplay($this->entityType, $this->bundle)
         ->setComponent($field_name, [
           'type' => $formatter,
         ])
@@ -239,7 +241,8 @@ public function testEntityFormatterRecursiveRendering() {
 
     // Set the default view mode to use the 'entity_reference_entity_view'
     // formatter.
-    entity_get_display($this->entityType, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => $formatter,
       ])
@@ -299,7 +302,8 @@ public function testEntityReferenceRecursiveProtectionWithManyRenderedEntities()
 
     // Set the default view mode to use the 'entity_reference_entity_view'
     // formatter.
-    entity_get_display($this->entityType, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => $formatter,
       ])
diff --git a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
index 05fdfae386..5824f5169b 100644
--- a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
@@ -39,7 +39,8 @@ public function testEntityDisplayBuild() {
 
     // Simple formatter, label displayed.
     $entity = clone($entity_init);
-    $display = entity_get_display($entity_type, $entity->bundle(), 'full');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($entity_type, $entity->bundle(), 'full');
 
     $formatter_setting = $this->randomMachineName();
     $display_options = [
@@ -135,7 +136,8 @@ public function testEntityDisplayBuild() {
    */
   public function testEntityDisplayViewMultiple() {
     // Use a formatter that has a prepareView() step.
-    $display = entity_get_display('entity_test', 'entity_test', 'full')
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($this->fieldTestData->field_name, [
         'type' => 'field_test_with_prepare_view',
       ]);
@@ -249,8 +251,11 @@ public function testEntityFormDisplayBuildForm() {
     $entity_type = 'entity_test';
     $entity = entity_create($entity_type, ['id' => 1, 'revision_id' => 1, 'type' => $this->fieldTestData->field->getTargetBundle()]);
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Test generating widgets for all fields.
-    $display = entity_get_form_display($entity_type, $this->fieldTestData->field->getTargetBundle(), 'default');
+    $display = $display_repository->getFormDisplay($entity_type, $this->fieldTestData->field->getTargetBundle());
     $form = [];
     $form_state = new FormState();
     $display->buildForm($entity, $form, $form_state);
@@ -267,7 +272,7 @@ public function testEntityFormDisplayBuildForm() {
     }
 
     // Test generating widgets for all fields.
-    $display = entity_get_form_display($entity_type, $this->fieldTestData->field->getTargetBundle(), 'default');
+    $display = $display_repository->getFormDisplay($entity_type, $this->fieldTestData->field->getTargetBundle());
     foreach ($display->getComponents() as $name => $options) {
       if ($name != $this->fieldTestData->field_name_2) {
         $display->removeComponent($name);
@@ -297,7 +302,8 @@ public function testEntityFormDisplayExtractFormValues() {
       ->create(['id' => 1, 'revision_id' => 1, 'type' => $this->fieldTestData->field->getTargetBundle()]);
 
     // Build the form for all fields.
-    $display = entity_get_form_display($entity_type, $this->fieldTestData->field->getTargetBundle(), 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $this->fieldTestData->field->getTargetBundle());
     $form = [];
     $form_state = new FormState();
     $display->buildForm($entity_init, $form, $form_state);
diff --git a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
index 98d7419f5f..65dcd9aa5a 100644
--- a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
+++ b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
@@ -107,7 +107,8 @@ protected function createFieldWithStorage($suffix = '', $entity_type = 'entity_t
     $this->fieldTestData->$field = FieldConfig::create($this->fieldTestData->$field_definition);
     $this->fieldTestData->$field->save();
 
-    entity_get_form_display($entity_type, $bundle, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $bundle)
       ->setComponent($this->fieldTestData->$field_name, [
         'type' => 'test_field_widget',
         'settings' => [
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
index c6f47fb1bd..75748a35ea 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
@@ -102,22 +102,25 @@ public function testWidgetSettings() {
     $expected['weight'] = 12;
     $this->assertIdentical($expected, $component);
 
-    $component = entity_get_form_display('node', 'employee', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $component = $display_repository->getFormDisplay('node', 'employee', 'default')
       ->getComponent('field_company');
     $this->assertInternalType('array', $component);
     $this->assertSame('options_select', $component['type']);
 
-    $component = entity_get_form_display('node', 'employee', 'default')
+    $component = $display_repository->getFormDisplay('node', 'employee', 'default')
       ->getComponent('field_company_2');
     $this->assertInternalType('array', $component);
     $this->assertSame('options_buttons', $component['type']);
 
-    $component = entity_get_form_display('node', 'employee', 'default')
+    $component = $display_repository->getFormDisplay('node', 'employee', 'default')
       ->getComponent('field_company_3');
     $this->assertInternalType('array', $component);
     $this->assertSame('entity_reference_autocomplete_tags', $component['type']);
 
-    $component = entity_get_form_display('node', 'employee', 'default')
+    $component = $display_repository->getFormDisplay('node', 'employee', 'default')
       ->getComponent('field_commander');
     $this->assertInternalType('array', $component);
     $this->assertSame('options_select', $component['type']);
diff --git a/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php b/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php
index fba3bda6b5..d6730f9c2f 100644
--- a/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php
@@ -73,7 +73,8 @@ protected function setUp() {
     ]);
     $instance->save();
 
-    $this->display = entity_get_display($this->entityType, $this->bundle, 'default')
+    $this->display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'string',
         'settings' => [],
diff --git a/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php b/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php
index f6087013c1..faa8218905 100644
--- a/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php
@@ -80,7 +80,8 @@ protected function setUp() {
     ]);
     $instance->save();
 
-    $this->display = entity_get_display($this->entityType, $this->bundle, 'default')
+    $this->display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'string',
         'settings' => [],
diff --git a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
index 9bb1f73acc..1734a7213b 100644
--- a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
@@ -70,7 +70,8 @@ protected function setUp() {
     ]);
     $instance->save();
 
-    $this->display = entity_get_display($this->entityType, $this->bundle, 'default')
+    $this->display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'boolean',
         'settings' => [],
diff --git a/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php b/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
index 86cc362109..1ea0db728d 100644
--- a/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
@@ -58,7 +58,8 @@ public function testUriField() {
     $this->field->save();
 
     // Create a form display for the default form mode.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'uri',
       ])
diff --git a/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php b/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
index 395a2b1303..66d1f33f27 100644
--- a/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
+++ b/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
@@ -55,7 +55,8 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, arr
    * {@inheritdoc}
    */
   protected function getEntityDisplay($entity_type_id, $bundle, $mode) {
-    return entity_get_form_display($entity_type_id, $bundle, $mode);
+    return \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type_id, $bundle, $mode);
   }
 
   /**
diff --git a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
index cbaf65f88e..eb5ecac690 100644
--- a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
+++ b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
@@ -88,7 +88,7 @@ protected function buildExtraFieldRow($field_id, $extra_field) {
    * {@inheritdoc}
    */
   protected function getEntityDisplay($entity_type_id, $bundle, $mode) {
-    return entity_get_display($entity_type_id, $bundle, $mode);
+    return $this->entityDisplayRepository->getViewDisplay($entity_type_id, $bundle, $mode);
   }
 
   /**
diff --git a/core/modules/field_ui/src/Form/FieldStorageAddForm.php b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
index fca4f86a73..49b316556d 100644
--- a/core/modules/field_ui/src/Form/FieldStorageAddForm.php
+++ b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
@@ -461,7 +461,7 @@ protected function configureEntityFormDisplay($field_name, $widget_id = NULL, ar
     // Make sure the field is displayed in the 'default' form mode (using
     // default widget and settings). It stays hidden for other form modes
     // until it is explicitly configured.
-    entity_get_form_display($this->entityTypeId, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay($this->entityTypeId, $this->bundle, 'default')
       ->setComponent($field_name, $options)
       ->save();
   }
@@ -487,7 +487,7 @@ protected function configureEntityViewDisplay($field_name, $formatter_id = NULL,
     // Make sure the field is displayed in the 'default' view mode (using
     // default formatter and settings). It stays hidden for other view
     // modes until it is explicitly configured.
-    entity_get_display($this->entityTypeId, $this->bundle, 'default')
+    \Drupal::service('entity_display.repository')->getViewDisplay($this->entityTypeId, $this->bundle)
       ->setComponent($field_name, $options)
       ->save();
   }
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
index 85a5017cb1..a8479c00f9 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
@@ -101,7 +101,8 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', 'field_' . $vocabulary->id(), 'Tags', 'taxonomy_term', 'default', $handler_settings);
 
-    entity_get_form_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'article')
       ->setComponent('field_' . $vocabulary->id())
       ->save();
   }
@@ -419,7 +420,10 @@ public function testDefaultValue() {
     ]);
     $field->save();
 
-    entity_get_form_display('node', $this->contentType, 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('node', $this->contentType)
       ->setComponent($field_name)
       ->save();
 
@@ -471,8 +475,9 @@ public function testDefaultValue() {
     $this->assertEqual($field->getDefaultValueLiteral(), [], 'The default value was correctly saved.');
 
     // Check that the default widget is used when the field is hidden.
-    entity_get_form_display($field->getTargetEntityTypeId(), $field->getTargetBundle(), 'default')
-      ->removeComponent($field_name)->save();
+    $display_repository->getFormDisplay($field->getTargetEntityTypeId(), $field->getTargetBundle())
+      ->removeComponent($field_name)
+      ->save();
     $this->drupalGet($admin_path);
     $this->assertFieldById($element_id, '', 'The default value widget was displayed when field is hidden.');
   }
@@ -556,7 +561,8 @@ public function testLockedField() {
       'field_storage' => $field_storage,
       'bundle' => $this->contentType,
     ])->save();
-    entity_get_form_display('node', $this->contentType, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', $this->contentType)
       ->setComponent($field_name, [
         'type' => 'test_field_widget',
       ])
@@ -593,7 +599,8 @@ public function testHiddenFields() {
       'label' => t('Hidden field'),
     ];
     FieldConfig::create($field)->save();
-    entity_get_form_display('node', $this->contentType, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', $this->contentType)
       ->setComponent($field_name)
       ->save();
     $this->assertTrue(FieldConfig::load('node.' . $this->contentType . '.' . $field_name), format_string('A field of the field storage %field was created programmatically.', ['%field' => $field_name]));
@@ -689,7 +696,10 @@ public function testHelpDescriptions() {
       'bundle' => 'article',
     ])->save();
 
-    entity_get_form_display('node', 'article', 'default')->setComponent('field_image')->save();
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'article')
+      ->setComponent('field_image')
+      ->save();
 
     $edit = [
       'description' => '<strong>Test with an upload field.',
@@ -743,9 +753,12 @@ public function testPreconfiguredFields() {
     $this->assertTrue($field->isRequired());
     $this->assertEqual($field->getSetting('test_field_setting'), 'preconfigured_field_setting');
 
-    $form_display = entity_get_form_display('node', 'article', 'default');
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $form_display = $display_repository->getFormDisplay('node', 'article');
     $this->assertEqual($form_display->getComponent('field_test_custom_options')['type'], 'test_field_widget_multiple');
-    $view_display = entity_get_display('node', 'article', 'default');
+    $view_display = $display_repository->getViewDisplay('node', 'article');
     $this->assertEqual($view_display->getComponent('field_test_custom_options')['type'], 'field_test_multiple');
     $this->assertEqual($view_display->getComponent('field_test_custom_options')['settings']['test_formatter_setting_multiple'], 'altered dummy test string');
   }
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
index 10f391d3e6..d12061e353 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
@@ -134,20 +134,24 @@ public function testEntityDisplayCRUDSort() {
   }
 
   /**
-   * Tests entity_get_display().
+   * Tests EntityDisplayRepositoryInterface::getViewDisplay().
+   *
+   * @covers \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewDisplay
    */
   public function testEntityGetDisplay() {
-    // Check that entity_get_display() returns a fresh object when no
-    // configuration entry exists.
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display_repository = $this->container->get('entity_display.repository');
+
+    // Check that getViewDisplay() returns a fresh object when no configuration
+    // entry exists.
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertTrue($display->isNew());
 
     // Add some components and save the display.
     $display->setComponent('component_1', ['weight' => 10, 'settings' => []])
       ->save();
 
-    // Check that entity_get_display() returns the correct object.
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    // Check that getViewDisplay() returns the correct object.
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertFalse($display->isNew());
     $this->assertEqual($display->id(), 'entity_test.entity_test.default');
     $this->assertEqual($display->getComponent('component_1'), ['weight' => 10, 'settings' => [], 'third_party_settings' => [], 'region' => 'content']);
@@ -348,8 +352,10 @@ public function testDeleteBundle() {
     $type = NodeType::create(['type' => 'article']);
     $type->save();
     node_add_body_field($type);
-    entity_get_display('node', 'article', 'default')->save();
-    entity_get_form_display('node', 'article', 'default')->save();
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getViewDisplay('node', 'article')->save();
+    $display_repository->getFormDisplay('node', 'article')->save();
 
     // Delete the bundle.
     $type->delete();
@@ -390,19 +396,22 @@ public function testDeleteField() {
       'mode' => 'teaser',
     ])->setComponent($field_name)->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Check the component exists.
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertTrue($display->getComponent($field_name));
-    $display = entity_get_display('entity_test', 'entity_test', 'teaser');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test', 'teaser');
     $this->assertTrue($display->getComponent($field_name));
 
     // Delete the field.
     $field->delete();
 
     // Check that the component has been removed from the entity displays.
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertFalse($display->getComponent($field_name));
-    $display = entity_get_display('entity_test', 'entity_test', 'teaser');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test', 'teaser');
     $this->assertFalse($display->getComponent($field_name));
   }
 
@@ -432,19 +441,22 @@ public function testOnDependencyRemoval() {
       'mode' => 'default',
     ])->setComponent($field_name, ['type' => 'field_plugins_test_text_formatter'])->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Check the component exists and is of the correct type.
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertEqual($display->getComponent($field_name)['type'], 'field_plugins_test_text_formatter');
 
     // Removing the field_plugins_test module should change the component to use
     // the default formatter for test fields.
     \Drupal::service('config.manager')->uninstall('module', 'field_plugins_test');
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertEqual($display->getComponent($field_name)['type'], 'text_default');
 
     // Removing the text module should remove the field from the view display.
     \Drupal::service('config.manager')->uninstall('module', 'text');
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getViewDisplay('entity_test', 'entity_test');
     $this->assertFalse($display->getComponent($field_name));
   }
 
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
index 2baee4df6a..043026990d 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
@@ -28,20 +28,26 @@ protected function setUp() {
   }
 
   /**
-   * Tests entity_get_form_display().
+   * Tests EntityDisplayRepositoryInterface::getFormDisplay().
+   *
+   * @covers \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormDisplay
    */
   public function testEntityGetFromDisplay() {
-    // Check that entity_get_form_display() returns a fresh object when no
-    // configuration entry exists.
-    $form_display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    // Check that EntityDisplayRepositoryInterface::getFormDisplay() returns a
+    // fresh object when no configuration entry exists.
+    $form_display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertTrue($form_display->isNew());
 
     // Add some components and save the display.
     $form_display->setComponent('component_1', ['weight' => 10])
       ->save();
 
-    // Check that entity_get_form_display() returns the correct object.
-    $form_display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    // Check that EntityDisplayRepositoryInterface::getFormDisplay() returns the
+    // correct object.
+    $form_display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertFalse($form_display->isNew());
     $this->assertEqual($form_display->id(), 'entity_test.entity_test.default');
     $this->assertEqual($form_display->getComponent('component_1'), ['weight' => 10, 'settings' => [], 'third_party_settings' => [], 'region' => 'content']);
@@ -208,19 +214,22 @@ public function testDeleteField() {
       'mode' => 'compact',
     ])->setComponent($field_name)->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Check the component exists.
-    $display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertTrue($display->getComponent($field_name));
-    $display = entity_get_form_display('entity_test', 'entity_test', 'compact');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test', 'compact');
     $this->assertTrue($display->getComponent($field_name));
 
     // Delete the field.
     $field->delete();
 
     // Check that the component has been removed from the entity displays.
-    $display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertFalse($display->getComponent($field_name));
-    $display = entity_get_form_display('entity_test', 'entity_test', 'compact');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test', 'compact');
     $this->assertFalse($display->getComponent($field_name));
   }
 
@@ -250,19 +259,22 @@ public function testOnDependencyRemoval() {
       'mode' => 'default',
     ])->setComponent($field_name, ['type' => 'field_plugins_test_text_widget'])->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Check the component exists and is of the correct type.
-    $display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertEqual($display->getComponent($field_name)['type'], 'field_plugins_test_text_widget');
 
     // Removing the field_plugins_test module should change the component to use
     // the default widget for test fields.
     \Drupal::service('config.manager')->uninstall('module', 'field_plugins_test');
-    $display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertEqual($display->getComponent($field_name)['type'], 'text_textfield');
 
     // Removing the text module should remove the field from the form display.
     \Drupal::service('config.manager')->uninstall('module', 'text');
-    $display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    $display = $display_repository->getFormDisplay('entity_test', 'entity_test');
     $this->assertFalse($display->getComponent($field_name));
   }
 
diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php
index 6d53cd4eae..9bc7dc9949 100644
--- a/core/modules/file/src/Tests/FileFieldTestBase.php
+++ b/core/modules/file/src/Tests/FileFieldTestBase.php
@@ -117,14 +117,17 @@ public function attachFileField($name, $entity_type, $bundle, $field_settings =
     ];
     FieldConfig::create($field)->save();
 
-    entity_get_form_display($entity_type, $bundle, 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay($entity_type, $bundle)
       ->setComponent($name, [
         'type' => 'file_generic',
         'settings' => $widget_settings,
       ])
       ->save();
     // Assign display settings.
-    entity_get_display($entity_type, $bundle, 'default')
+    $display_repository->getViewDisplay($entity_type, $bundle)
       ->setComponent($name, [
         'label' => 'hidden',
         'type' => 'file_default',
@@ -140,7 +143,8 @@ public function updateFileField($name, $type_name, $field_settings = [], $widget
     $field->setSettings(array_merge($field->getSettings(), $field_settings));
     $field->save();
 
-    entity_get_form_display('node', $type_name, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', $type_name)
       ->setComponent($name, [
         'settings' => $widget_settings,
       ])
diff --git a/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php b/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php
index 89c713e077..905cf6c325 100644
--- a/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php
+++ b/core/modules/file/tests/src/Functional/FileFieldCreationTrait.php
@@ -68,14 +68,14 @@ public function attachFileField($name, $entity_type, $bundle, $field_settings =
     ];
     FieldConfig::create($field)->save();
 
-    entity_get_form_display($entity_type, $bundle, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay($entity_type, $bundle)
       ->setComponent($name, [
         'type' => 'file_generic',
         'settings' => $widget_settings,
       ])
       ->save();
     // Assign display settings.
-    entity_get_display($entity_type, $bundle, 'default')
+    \Drupal::service('entity_display.repository')->getViewDisplay($entity_type, $bundle)
       ->setComponent($name, [
         'label' => 'hidden',
         'type' => 'file_default',
diff --git a/core/modules/file/tests/src/Functional/FileFieldTestBase.php b/core/modules/file/tests/src/Functional/FileFieldTestBase.php
index d9ac4bd0e5..6ae309400e 100644
--- a/core/modules/file/tests/src/Functional/FileFieldTestBase.php
+++ b/core/modules/file/tests/src/Functional/FileFieldTestBase.php
@@ -73,7 +73,7 @@ public function updateFileField($name, $type_name, $field_settings = [], $widget
     $field->setSettings(array_merge($field->getSettings(), $field_settings));
     $field->save();
 
-    entity_get_form_display('node', $type_name, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', $type_name)
       ->setComponent($name, [
         'settings' => $widget_settings,
       ])
diff --git a/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php b/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php
index 228b1d6f05..aca03382da 100644
--- a/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php
+++ b/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php
@@ -64,11 +64,13 @@ protected function createMediaField($formatter, $file_extensions, array $formatt
     ]);
     $field_config->save();
 
-    $display = entity_get_display('entity_test', 'entity_test', 'full');
-    $display->setComponent($field_name, [
-      'type' => $formatter,
-      'settings' => $formatter_settings,
-    ])->save();
+    $this->container->get('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test', 'full')
+      ->setComponent($field_name, [
+        'type' => $formatter,
+        'settings' => $formatter_settings,
+      ])
+      ->save();
 
     return $field_config;
   }
diff --git a/core/modules/file/tests/src/Kernel/FileItemTest.php b/core/modules/file/tests/src/Kernel/FileItemTest.php
index bc6eb5457f..fd7c4b2114 100644
--- a/core/modules/file/tests/src/Kernel/FileItemTest.php
+++ b/core/modules/file/tests/src/Kernel/FileItemTest.php
@@ -132,7 +132,8 @@ public function testFileItem() {
     $file3 = File::create([
       'uri' => 'public://example-3.txt',
     ]);
-    $display = entity_get_display('entity_test', 'entity_test', 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test');
     $display->setComponent('file_test', [
       'label' => 'above',
       'type' => 'file_default',
diff --git a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
index ca27293982..7f5b3e8e79 100644
--- a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
@@ -311,7 +311,8 @@ public function testStyleReplacement() {
     // Create an image field that uses the new style.
     $field_name = strtolower($this->randomMachineName(10));
     $this->createImageField($field_name, 'article');
-    entity_get_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'image',
         'settings' => ['image_style' => $style_name],
@@ -456,7 +457,8 @@ public function testConfigImport() {
     // Create an image field that uses the new style.
     $field_name = strtolower($this->randomMachineName(10));
     $this->createImageField($field_name, 'article');
-    entity_get_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'image',
         'settings' => ['image_style' => $style_name],
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
index 3998b350e7..37fa04c793 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
@@ -107,11 +107,14 @@ public function testDefaultImages() {
     ]);
     $field2->save();
 
-    $widget_settings = entity_get_form_display('node', $field->getTargetBundle(), 'default')->getComponent($field_name);
-    entity_get_form_display('node', 'page', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $widget_settings = $display_repository->getFormDisplay('node', $field->getTargetBundle())->getComponent($field_name);
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent($field_name, $widget_settings)
       ->save();
-    entity_get_display('node', 'page', 'default')
+    $display_repository->getViewDisplay('node', 'page')
       ->setComponent($field_name)
       ->save();
 
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
index b1355fe05b..b4f52baa3f 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
@@ -117,7 +117,8 @@ public function _testImageFieldFormatters($scheme) {
       'type' => 'image',
       'settings' => ['image_link' => 'file'],
     ];
-    $display = entity_get_display('node', $node->getType(), 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', $node->getType());
     $display->setComponent($field_name, $display_options)
       ->save();
 
diff --git a/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php b/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php
index 851b424bfb..a528dfe47c 100644
--- a/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php
+++ b/core/modules/image/tests/src/Kernel/ImageFieldCreationTrait.php
@@ -50,14 +50,16 @@ protected function createImageField($name, $type_name, $storage_settings = [], $
     ]);
     $field_config->save();
 
-    entity_get_form_display('node', $type_name, 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', $type_name)
       ->setComponent($name, [
         'type' => 'image_image',
         'settings' => $widget_settings,
       ])
       ->save();
 
-    entity_get_display('node', $type_name, 'default')
+    $display_repository->getViewDisplay('node', $type_name)
       ->setComponent($name, [
         'type' => 'image',
         'settings' => $formatter_settings,
diff --git a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
index 1baa830199..56b552e59c 100644
--- a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
@@ -74,7 +74,8 @@ protected function setUp() {
       ],
     ])->save();
 
-    $this->display = entity_get_display($this->entityType, $this->bundle, 'default')
+    $this->display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($this->entityType, $this->bundle)
       ->setComponent($this->fieldName, [
         'type' => 'image',
         'label' => 'hidden',
diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php
index 76be35e774..d377888f68 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -76,7 +76,9 @@ public function testURLValidation() {
       ],
     ]);
     $this->field->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'link_default',
         'settings' => [
@@ -84,7 +86,7 @@ public function testURLValidation() {
         ],
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, [
         'type' => 'link',
       ])
@@ -248,7 +250,9 @@ public function testLinkTitle() {
       ],
     ]);
     $this->field->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'link_default',
         'settings' => [
@@ -257,7 +261,7 @@ public function testLinkTitle() {
         ],
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, [
         'type' => 'link',
         'label' => 'hidden',
@@ -370,7 +374,9 @@ public function testLinkFormatter() {
         'link_type' => LinkItemInterface::LINK_GENERIC,
       ],
     ])->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'link_default',
       ])
@@ -379,7 +385,7 @@ public function testLinkFormatter() {
       'type' => 'link',
       'label' => 'hidden',
     ];
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, $display_options)
       ->save();
 
@@ -438,7 +444,7 @@ public function testLinkFormatter() {
         else {
           $display_options['settings'] = $new_value;
         }
-        entity_get_display('entity_test', 'entity_test', 'full')
+        $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
           ->setComponent($field_name, $display_options)
           ->save();
 
@@ -528,12 +534,14 @@ public function testLinkSeparateFormatter() {
       'type' => 'link_separate',
       'label' => 'hidden',
     ];
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => 'link_default',
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name, $display_options)
       ->save();
 
@@ -572,7 +580,7 @@ public function testLinkSeparateFormatter() {
       foreach ($values as $new_value) {
         // Update the field formatter settings.
         $display_options['settings'] = [$setting => $new_value];
-        entity_get_display('entity_test', 'entity_test', 'full')
+        $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
           ->setComponent($field_name, $display_options)
           ->save();
 
@@ -745,7 +753,8 @@ protected function renderTestEntity($id, $view_mode = 'full', $reset = TRUE) {
       $this->container->get('entity.manager')->getStorage('entity_test')->resetCache([$id]);
     }
     $entity = EntityTest::load($id);
-    $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), $view_mode);
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($entity->getEntityTypeId(), $entity->bundle(), $view_mode);
     $content = $display->build($entity);
     $output = \Drupal::service('renderer')->renderRoot($content);
     $output = (string) $output;
diff --git a/core/modules/media/src/MediaTypeForm.php b/core/modules/media/src/MediaTypeForm.php
index f2aea499c4..603af18f16 100644
--- a/core/modules/media/src/MediaTypeForm.php
+++ b/core/modules/media/src/MediaTypeForm.php
@@ -5,6 +5,7 @@
 use Drupal\Component\Plugin\PluginManagerInterface;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\ReplaceCommand;
+use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Field\BaseFieldDefinition;
@@ -35,6 +36,13 @@ class MediaTypeForm extends EntityForm {
    */
   protected $entityFieldManager;
 
+  /**
+   * Entity display repository service.
+   *
+   * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
+   */
+  protected $entityDisplayRepository;
+
   /**
    * Constructs a new class instance.
    *
@@ -42,10 +50,13 @@ class MediaTypeForm extends EntityForm {
    *   Media source plugin manager.
    * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
    *   Entity field manager service.
+   * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entityDisplayRepository
+   *   Entity display repository service.
    */
-  public function __construct(PluginManagerInterface $source_manager, EntityFieldManagerInterface $entity_field_manager) {
+  public function __construct(PluginManagerInterface $source_manager, EntityFieldManagerInterface $entity_field_manager, EntityDisplayRepositoryInterface $entityDisplayRepository) {
     $this->sourceManager = $source_manager;
     $this->entityFieldManager = $entity_field_manager;
+    $this->entityDisplayRepository = $entityDisplayRepository;
   }
 
   /**
@@ -54,7 +65,8 @@ public function __construct(PluginManagerInterface $source_manager, EntityFieldM
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('plugin.manager.media.source'),
-      $container->get('entity_field.manager')
+      $container->get('entity_field.manager'),
+      $container->get('entity_display.repository')
     );
   }
 
@@ -345,16 +357,12 @@ public function save(array $form, FormStateInterface $form_state) {
       // Add the new field to the default form and view displays for this
       // media type.
       if ($source_field->isDisplayConfigurable('form')) {
-        // @todo Replace entity_get_form_display() when #2367933 is done.
-        // https://www.drupal.org/node/2872159.
-        $display = entity_get_form_display('media', $media_type->id(), 'default');
+        $display = $this->entityDisplayRepository->getFormDisplay('media', $media_type->id());
         $source->prepareFormDisplay($media_type, $display);
         $display->save();
       }
       if ($source_field->isDisplayConfigurable('view')) {
-        // @todo Replace entity_get_display() when #2367933 is done.
-        // https://www.drupal.org/node/2872159.
-        $display = entity_get_display('media', $media_type->id(), 'default');
+        $display = $this->entityDisplayRepository->getViewDisplay('media', $media_type->id());
         $source->prepareViewDisplay($media_type, $display);
         $display->save();
       }
diff --git a/core/modules/media/tests/src/Functional/MediaAccessTest.php b/core/modules/media/tests/src/Functional/MediaAccessTest.php
index 926686d13c..7363c30a16 100644
--- a/core/modules/media/tests/src/Functional/MediaAccessTest.php
+++ b/core/modules/media/tests/src/Functional/MediaAccessTest.php
@@ -366,7 +366,7 @@ public function testReferencedRendering() {
     ]);
     $media_parent->save();
 
-    entity_get_display('media', $media_type->id(), 'full')
+    \Drupal::service('entity_display.repository')->getViewDisplay('media', $media_type->id(), 'full')
       ->set('content', [])
       ->setComponent('title', ['type' => 'string'])
       ->setComponent('field_reference', [
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
index b893eeafad..2c3bae63e4 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
@@ -161,7 +161,7 @@ public function testMediaDisplay() {
       ],
     ])->save();
 
-    entity_get_display('node', $node_type->id(), 'default')
+    \Drupal::service('entity_display.repository')->getViewDisplay('node', $node_type->id())
       ->setComponent('field_related_media', [
         'type' => 'entity_reference_entity_view',
         'label' => 'hidden',
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
index 7e2f2c48ec..5f595972f9 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
@@ -93,7 +93,7 @@ public function testMediaOEmbedVideoSource() {
 
     // Configure the iframe to be narrower than the actual video, so we can
     // verify that the video scales correctly.
-    $display = entity_get_display('media', $media_type_id, 'default');
+    $display = \Drupal::service('entity_display.repository')->getViewDisplay('media', $media_type_id);
     $this->assertFalse($display->isNew());
     $component = $display->getComponent('field_media_oembed_video');
     $this->assertInternalType('array', $component);
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php
index bd029ca88e..53ea9bf690 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php
@@ -54,9 +54,10 @@ protected function createMediaTypeField($field_name, $field_type, $media_type_id
     $component = \Drupal::service('plugin.manager.field.widget')
       ->prepareConfiguration($field_type, []);
 
-    // @todo Replace entity_get_form_display() when #2367933 is done.
-    // https://www.drupal.org/node/2872159.
-    $entity_form_display = entity_get_form_display('media', $media_type_id, 'default');
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $entity_form_display = $display_repository->getFormDisplay('media', $media_type_id, 'default');
     $entity_form_display->setComponent($field_name, $component)
       ->save();
 
@@ -64,9 +65,7 @@ protected function createMediaTypeField($field_name, $field_type, $media_type_id
     $component = \Drupal::service('plugin.manager.field.formatter')
       ->prepareConfiguration($field_type, []);
 
-    // @todo Replace entity_get_display() when #2367933 is done.
-    // https://www.drupal.org/node/2872159.
-    $entity_display = entity_get_display('media', $media_type_id, 'default');
+    $entity_display = $display_repository->getViewDisplay('media', $media_type_id);
     $entity_display->setComponent($field_name, $component)
       ->save();
   }
@@ -94,8 +93,12 @@ protected function createMediaTypeFields(array $fields, $media_type_id) {
    *   The media type config entity ID.
    */
   protected function hideMediaTypeFieldWidget($field_name, $media_type_id) {
+
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $entity_form_display */
-    $entity_form_display = entity_get_form_display('media', $media_type_id, 'default');
+    $entity_form_display = $display_repository->getFormDisplay('media', $media_type_id, 'default');
     if ($entity_form_display->getComponent($field_name)) {
       $entity_form_display->removeComponent($field_name)->save();
     }
diff --git a/core/modules/media/tests/src/Kernel/MediaSourceTest.php b/core/modules/media/tests/src/Kernel/MediaSourceTest.php
index ecf1778504..b998927a40 100644
--- a/core/modules/media/tests/src/Kernel/MediaSourceTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaSourceTest.php
@@ -530,12 +530,12 @@ public function testDifferentSourceFieldDisplays() {
     $this->createMediaTypeViaForm($id, $field_name);
 
     // Source field not in displays.
-    $display = entity_get_display('media', $id, 'default');
+    $display = \Drupal::service('entity_display.repository')->getViewDisplay('media', $id);
     $components = $display->getComponents();
     $this->assertArrayHasKey($field_name, $components);
     $this->assertSame('entity_reference_entity_id', $components[$field_name]['type']);
 
-    $display = entity_get_form_display('media', $id, 'default');
+    $display = \Drupal::service('entity_display.repository')->getFormDisplay('media', $id);
     $components = $display->getComponents();
     $this->assertArrayHasKey($field_name, $components);
     $this->assertSame('entity_reference_autocomplete_tags', $components[$field_name]['type']);
@@ -551,10 +551,10 @@ public function testHiddenSourceField() {
     $this->createMediaTypeViaForm($id, $field_name);
 
     // Source field not in displays.
-    $display = entity_get_display('media', $id, 'default');
+    $display = \Drupal::service('entity_display.repository')->getViewDisplay('media', $id);
     $this->assertArrayNotHasKey($field_name, $display->getComponents());
 
-    $display = entity_get_form_display('media', $id, 'default');
+    $display = \Drupal::service('entity_display.repository')->getFormDisplay('media', $id);
     $this->assertArrayNotHasKey($field_name, $display->getComponents());
   }
 
diff --git a/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php b/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php
index fb69b8e494..72fa88ddb5 100644
--- a/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php
+++ b/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php
@@ -65,7 +65,7 @@ protected function createMediaType($source_plugin_id, array $values = []) {
     $source_field->save();
 
     // Add the source field to the form display for the media type.
-    $form_display = entity_get_form_display('media', $media_type->id(), 'default');
+    $form_display = \Drupal::service('entity_display.repository')->getFormDisplay('media', $media_type->id(), 'default');
     $source->prepareFormDisplay($media_type, $form_display);
     $form_display->save();
 
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php b/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php
index 3b9a982f0f..0ad3d6d9af 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php
@@ -56,7 +56,8 @@ class PerComponentEntityDisplay extends ComponentEntityDisplayBase {
    * {@inheritdoc}
    */
   protected function getEntity($entity_type, $bundle, $view_mode) {
-    return entity_get_display($entity_type, $bundle, $view_mode);
+    return \Drupal::service('entity_display.repository')
+      ->getViewDisplay($entity_type, $bundle, $view_mode);
   }
 
 }
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityFormDisplay.php b/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityFormDisplay.php
index bd837f03f7..0ee86b1c14 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityFormDisplay.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityFormDisplay.php
@@ -49,7 +49,8 @@ class PerComponentEntityFormDisplay extends ComponentEntityDisplayBase {
    * {@inheritdoc}
    */
   protected function getEntity($entity_type, $bundle, $form_mode) {
-    return entity_get_form_display($entity_type, $bundle, $form_mode);
+    return \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $bundle, $form_mode);
   }
 
 }
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 21d92a28b8..0be08b45dc 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -367,15 +367,18 @@ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') {
     ]);
     $field->save();
 
-    // Assign widget settings for the 'default' form mode.
-    entity_get_form_display('node', $type->id(), 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    // Assign widget settings for the default form mode.
+    $display_repository->getFormDisplay('node', $type->id())
       ->setComponent('body', [
         'type' => 'text_textarea_with_summary',
       ])
       ->save();
 
     // Assign display settings for the 'default' and 'teaser' view modes.
-    entity_get_display('node', $type->id(), 'default')
+    $display_repository->getViewDisplay('node', $type->id())
       ->setComponent('body', [
         'label' => 'hidden',
         'type' => 'text_default',
@@ -386,7 +389,7 @@ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') {
     // might not exist.
     $view_modes = \Drupal::service('entity_display.repository')->getViewModes('node');
     if (isset($view_modes['teaser'])) {
-      entity_get_display('node', $type->id(), 'teaser')
+      $display_repository->getViewDisplay('node', $type->id(), 'teaser')
         ->setComponent('body', [
           'label' => 'hidden',
           'type' => 'text_summary_or_trimmed',
diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc
index b44343b663..30bd1c6b95 100644
--- a/core/modules/node/node.tokens.inc
+++ b/core/modules/node/node.tokens.inc
@@ -143,7 +143,9 @@ function node_tokens($type, $tokens, array $data, array $options, BubbleableMeta
 
                 // Get the 'trim_length' size used for the 'teaser' mode, if
                 // present, or use the default trim_length size.
-                $display_options = entity_get_display('node', $node->getType(), 'teaser')->getComponent('body');
+                $display_options = \Drupal::service('entity_display.repository')
+                  ->getViewDisplay('node', $node->getType(), 'teaser')
+                  ->getComponent('body');
                 if (isset($display_options['settings']['trim_length'])) {
                   $length = $display_options['settings']['trim_length'];
                 }
diff --git a/core/modules/node/src/Plugin/views/wizard/Node.php b/core/modules/node/src/Plugin/views/wizard/Node.php
index 0fd93675a8..b825994a8c 100644
--- a/core/modules/node/src/Plugin/views/wizard/Node.php
+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -213,7 +213,8 @@ protected function buildFilters(&$form, FormStateInterface $form_state) {
     }
     $tag_fields = [];
     foreach ($bundles as $bundle) {
-      $display = entity_get_form_display($this->entityTypeId, $bundle, 'default');
+      $display = \Drupal::service('entity_display.repository')
+        ->getFormDisplay($this->entityTypeId, $bundle);
       $taxonomy_fields = array_filter(\Drupal::entityManager()->getFieldDefinitions($this->entityTypeId, $bundle), function ($field_definition) {
         return $field_definition->getType() == 'entity_reference' && $field_definition->getSetting('target_type') == 'taxonomy_term';
       });
diff --git a/core/modules/node/tests/modules/node_access_test/node_access_test.module b/core/modules/node/tests/modules/node_access_test/node_access_test.module
index 9fca50c4e7..589accef27 100644
--- a/core/modules/node/tests/modules/node_access_test/node_access_test.module
+++ b/core/modules/node/tests/modules/node_access_test/node_access_test.module
@@ -135,7 +135,8 @@ function node_access_test_add_field(NodeTypeInterface $type) {
   $field->save();
 
   // Assign widget settings for the 'default' form mode.
-  entity_get_form_display('node', $type->id(), 'default')
+  \Drupal::service('entity_display.repository')
+    ->getFormDisplay('node', $type->id())
     ->setComponent('private', [
       'type' => 'number',
     ])
diff --git a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
index 93c2257864..7bc1775f4a 100644
--- a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
+++ b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
@@ -43,7 +43,8 @@ public function testMultiStepNodeFormBasicOptions() {
       'bundle' => 'page',
       'label' => $this->randomMachineName() . '_label',
     ])->save();
-    entity_get_form_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'page')
       ->setComponent($this->fieldName, [
         'type' => 'text_textfield',
       ])
diff --git a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
index ab6f28df94..f466886f28 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
@@ -61,10 +61,12 @@ protected function setUp() {
       'entity_type' => 'node',
       'bundle' => 'page',
     ])->save();
-    entity_get_display('node', 'page', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getViewDisplay('node', 'page')
       ->setComponent($this->fieldName)
       ->save();
-    entity_get_form_display('node', 'page', 'default')
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent($this->fieldName)
       ->save();
   }
diff --git a/core/modules/node/tests/src/Functional/NodeLinksTest.php b/core/modules/node/tests/src/Functional/NodeLinksTest.php
index 7bd725b46b..730ba47729 100644
--- a/core/modules/node/tests/src/Functional/NodeLinksTest.php
+++ b/core/modules/node/tests/src/Functional/NodeLinksTest.php
@@ -33,7 +33,8 @@ public function testHideLinks() {
     $this->assertLink('Read more');
 
     // Hide links.
-    entity_get_display('node', 'article', 'teaser')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article', 'teaser')
       ->removeComponent('links')
       ->save();
 
diff --git a/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php b/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php
index 0ebedfb8fb..e6d466b175 100644
--- a/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php
@@ -26,7 +26,8 @@ public function testViewLanguage() {
     ConfigurableLanguage::createFromLangcode('es')->save();
 
     // Set language field visible.
-    entity_get_display('node', 'page', 'full')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'page', 'full')
       ->setComponent('langcode')
       ->save();
 
diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php
index 30ca678ee3..26fc64b17e 100644
--- a/core/modules/node/tests/src/Functional/PagePreviewTest.php
+++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php
@@ -100,32 +100,35 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'page', $this->fieldName, 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'page', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_autocomplete_tags',
       ])
       ->save();
 
     // Show on default display and teaser.
-    entity_get_display('node', 'page', 'default')
+    $display_repository->getViewDisplay('node', 'page')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_label',
       ])
       ->save();
-    entity_get_display('node', 'page', 'teaser')
+    $display_repository->getViewDisplay('node', 'page', 'teaser')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_label',
       ])
       ->save();
 
-    entity_get_form_display('node', 'page', 'default')
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent('field_image', [
         'type' => 'image_image',
         'settings' => [],
       ])
       ->save();
 
-    entity_get_display('node', 'page', 'default')
+    $display_repository->getViewDisplay('node', 'page')
       ->setComponent('field_image')
       ->save();
 
@@ -145,13 +148,13 @@ protected function setUp() {
       'bundle' => 'page',
     ])->save();
 
-    entity_get_form_display('node', 'page', 'default')
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent('field_test_multi', [
         'type' => 'text_textfield',
       ])
       ->save();
 
-    entity_get_display('node', 'page', 'default')
+    $display_repository->getViewDisplay('node', 'page')
       ->setComponent('field_test_multi', [
         'type' => 'string',
       ])
@@ -199,7 +202,8 @@ public function testPagePreview() {
     $uuid = array_pop($paths);
 
     // Switch view mode. We'll remove the body from the teaser view mode.
-    entity_get_display('node', 'page', 'teaser')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'page', 'teaser')
       ->removeComponent('body')
       ->save();
 
diff --git a/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php b/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
index c2ee2f2763..154985deaa 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
@@ -95,7 +95,10 @@ public function testFilters() {
    */
   protected function assertPageCounts($path, $counts, $message) {
     // Disable read more links.
-    entity_get_display('node', 'page', 'teaser')->removeComponent('links')->save();
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'page', 'teaser')
+      ->removeComponent('links')
+      ->save();
 
     // Get the text of the page.
     $this->drupalGet($path);
diff --git a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
index 3c69ff764c..7a0d187ac2 100644
--- a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
+++ b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
@@ -99,7 +99,8 @@ public function testSummaryLength() {
     $this->assertRaw($expected);
 
     // Change the teaser length for "Basic page" content type.
-    $display = entity_get_display('node', $node->getType(), 'teaser');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', $node->getType(), 'teaser');
     $display_options = $display->getComponent('body');
     $display_options['settings']['trim_length'] = 200;
     $display->setComponent('body', $display_options)
diff --git a/core/modules/options/tests/src/Functional/OptionsDynamicValuesTestBase.php b/core/modules/options/tests/src/Functional/OptionsDynamicValuesTestBase.php
index 1b39cf6da7..e73611aba8 100644
--- a/core/modules/options/tests/src/Functional/OptionsDynamicValuesTestBase.php
+++ b/core/modules/options/tests/src/Functional/OptionsDynamicValuesTestBase.php
@@ -54,7 +54,8 @@ protected function setUp() {
       'bundle' => 'entity_test_rev',
       'required' => TRUE,
     ])->save();
-    entity_get_form_display('entity_test_rev', 'entity_test_rev', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test_rev', 'entity_test_rev')
       ->setComponent($field_name, [
         'type' => 'options_select',
       ])
diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
index b61748397c..36f46cd9c8 100644
--- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -274,7 +274,10 @@ protected function createOptionsField($type) {
       'bundle' => $this->type,
     ])->save();
 
-    entity_get_form_display('node', $this->type, 'default')->setComponent($this->fieldName)->save();
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', $this->type)
+      ->setComponent($this->fieldName)
+      ->save();
 
     $this->adminPath = 'admin/structure/types/manage/' . $this->type . '/fields/node.' . $this->type . '.' . $this->fieldName . '/storage';
   }
diff --git a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
index 8363467c97..b75aacaa72 100644
--- a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
+++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
@@ -113,7 +113,8 @@ public function testRadioButtons() {
       'bundle' => 'entity_test',
     ]);
     $field->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->card1->getName(), [
         'type' => 'options_buttons',
       ])
@@ -170,7 +171,8 @@ public function testCheckBoxes() {
       'bundle' => 'entity_test',
     ]);
     $field->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->card2->getName(), [
         'type' => 'options_buttons',
       ])
@@ -260,7 +262,8 @@ public function testSelectListSingle() {
       'required' => TRUE,
     ]);
     $field->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->card1->getName(), [
         'type' => 'options_select',
       ])
@@ -359,7 +362,8 @@ public function testSelectListMultiple() {
       'bundle' => 'entity_test',
     ]);
     $field->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->card2->getName(), [
         'type' => 'options_select',
       ])
@@ -528,8 +532,11 @@ public function testEmptyValue() {
     ]);
     $field->save();
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Change it to the check boxes/radio buttons widget.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->card1->getName(), [
         'type' => 'options_buttons',
       ])
@@ -548,7 +555,7 @@ public function testEmptyValue() {
     $this->assertTrue($this->xpath('//div[@id=:id]//label[@for=:for and text()=:label]', [':id' => 'edit-card-1', ':for' => 'edit-card-1-none', ':label' => 'N/A']), 'A test radio button has a "N/A" choice.');
 
     // Change it to the select widget.
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->card1->getName(), [
         'type' => 'options_select',
       ])
diff --git a/core/modules/options/tests/src/Kernel/OptionsFieldTest.php b/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
index 401d6bc1da..a0aa6f72f8 100644
--- a/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
+++ b/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
@@ -80,7 +80,8 @@ public function testUpdateAllowedValues() {
       'bundle' => 'entity_test',
       'required' => TRUE,
     ])->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->fieldName, [
         'type' => 'options_buttons',
       ])
diff --git a/core/modules/options/tests/src/Kernel/OptionsFieldUnitTestBase.php b/core/modules/options/tests/src/Kernel/OptionsFieldUnitTestBase.php
index 9098b818b7..05f0c64a49 100644
--- a/core/modules/options/tests/src/Kernel/OptionsFieldUnitTestBase.php
+++ b/core/modules/options/tests/src/Kernel/OptionsFieldUnitTestBase.php
@@ -71,7 +71,8 @@ protected function setUp() {
     ]);
     $this->field->save();
 
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($this->fieldName, [
         'type' => 'options_buttons',
       ])
diff --git a/core/modules/path/tests/src/Functional/PathMediaFormTest.php b/core/modules/path/tests/src/Functional/PathMediaFormTest.php
index 3a96900810..7fd3a745be 100644
--- a/core/modules/path/tests/src/Functional/PathMediaFormTest.php
+++ b/core/modules/path/tests/src/Functional/PathMediaFormTest.php
@@ -52,7 +52,7 @@ public function testMediaForm() {
     $assert_session->fieldExists('path[0][alias]');
 
     // Disable the 'Path' field for this content type.
-    entity_get_form_display('media', $media_type_id, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('media', $media_type_id, 'default')
       ->removeComponent('path')
       ->save();
 
diff --git a/core/modules/path/tests/src/Functional/PathNodeFormTest.php b/core/modules/path/tests/src/Functional/PathNodeFormTest.php
index 3245b17c59..9070cc7530 100644
--- a/core/modules/path/tests/src/Functional/PathNodeFormTest.php
+++ b/core/modules/path/tests/src/Functional/PathNodeFormTest.php
@@ -37,7 +37,7 @@ public function testNodeForm() {
     $assert_session->fieldExists('path[0][alias]');
 
     // Disable the 'Path' field for this content type.
-    entity_get_form_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', 'page', 'default')
       ->removeComponent('path')
       ->save();
 
diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditAutocompleteTermTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditAutocompleteTermTest.php
index 375528b2e3..d58f0e7bb5 100644
--- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditAutocompleteTermTest.php
+++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditAutocompleteTermTest.php
@@ -97,20 +97,20 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', $this->fieldName, 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_autocomplete_tags',
         'weight' => -4,
       ])
       ->save();
 
-    entity_get_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')->getViewDisplay('node', 'article')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_label',
         'weight' => 10,
       ])
       ->save();
-    entity_get_display('node', 'article', 'teaser')
+    \Drupal::service('entity_display.repository')->getViewDisplay('node', 'article', 'teaser')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_label',
         'weight' => 10,
diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php
index 0ecd655a93..3699995dc5 100644
--- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php
+++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php
@@ -354,7 +354,7 @@ public function testImageField() {
       'entity_type' => 'node',
       'bundle' => 'article',
     ])->save();
-    entity_get_form_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', 'article', 'default')
       ->setComponent('field_image', [
         'type' => 'image_image',
       ])
diff --git a/core/modules/quickedit/tests/src/Kernel/EditorSelectionTest.php b/core/modules/quickedit/tests/src/Kernel/EditorSelectionTest.php
index 08a8fe04ad..f117a714a0 100644
--- a/core/modules/quickedit/tests/src/Kernel/EditorSelectionTest.php
+++ b/core/modules/quickedit/tests/src/Kernel/EditorSelectionTest.php
@@ -41,7 +41,9 @@ protected function getSelectedEditor($entity_id, $field_name, $view_mode = 'defa
     $storage->resetCache([$entity_id]);
     $entity = $storage->load($entity_id);
     $items = $entity->get($field_name);
-    $options = entity_get_display('entity_test', 'entity_test', $view_mode)->getComponent($field_name);
+    $options = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test', $view_mode)
+      ->getComponent($field_name);
     return $this->editorSelector->getEditor($options['type'], $items);
   }
 
diff --git a/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php b/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php
index 8cc2d2f8b6..127ab62d85 100644
--- a/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php
+++ b/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php
@@ -86,14 +86,17 @@ protected function createFieldWithStorage($field_name, $type, $cardinality, $lab
     ]);
     $this->fields->$field->save();
 
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => $widget_type,
         'settings' => $widget_settings,
       ])
       ->save();
 
-    entity_get_display('entity_test', 'entity_test', 'default')
+    $display_repository->getViewDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'label' => 'above',
         'type' => $formatter_type,
diff --git a/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php b/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
index 42be42f6bc..d4a97553aa 100644
--- a/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
+++ b/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
@@ -51,10 +51,13 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', $this->fieldName, 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName, ['type' => 'options_select'])
       ->save();
-    entity_get_display('node', 'article', 'full')
+    $display_repository->getViewDisplay('node', 'article', 'full')
       ->setComponent($this->fieldName, ['type' => 'entity_reference_label'])
       ->save();
 
@@ -80,7 +83,8 @@ protected function setUp() {
    */
   public function testNodeTeaser() {
     // Set the teaser display to show this field.
-    entity_get_display('node', 'article', 'teaser')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article', 'teaser')
       ->setComponent($this->fieldName, ['type' => 'entity_reference_label'])
       ->save();
 
diff --git a/core/modules/rdf/tests/src/Functional/FileFieldAttributesTest.php b/core/modules/rdf/tests/src/Functional/FileFieldAttributesTest.php
index c63db1af62..ebfe9ee9c9 100644
--- a/core/modules/rdf/tests/src/Functional/FileFieldAttributesTest.php
+++ b/core/modules/rdf/tests/src/Functional/FileFieldAttributesTest.php
@@ -50,7 +50,8 @@ protected function setUp() {
     $this->createFileField($this->fieldName, 'node', $type_name);
 
     // Set the teaser display to show this field.
-    entity_get_display('node', 'article', 'teaser')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article', 'teaser')
       ->setComponent($this->fieldName, ['type' => 'file_default'])
       ->save();
 
diff --git a/core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php b/core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php
index b8b4719671..e8dc715abe 100644
--- a/core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php
+++ b/core/modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php
@@ -83,7 +83,8 @@ public function testNodeTeaser() {
       'type' => 'image',
       'settings' => ['image_style' => 'medium', 'image_link' => 'content'],
     ];
-    $display = entity_get_display('node', 'article', 'teaser');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article', 'teaser');
     $display->setComponent($this->fieldName, $display_options)
       ->save();
 
diff --git a/core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php b/core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php
index 7d8e54bf77..450fbfae9e 100644
--- a/core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php
+++ b/core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php
@@ -87,7 +87,8 @@ protected function assertFormatterRdfa($formatter, $property, $expected_rdf_valu
 
     // The field formatter will be rendered inside the entity. Set the field
     // formatter in the entity display options before rendering the entity.
-    entity_get_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test')
       ->setComponent($this->fieldName, $formatter)
       ->save();
     $build = entity_view($this->entity, 'default');
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
index ac3a0f007c..c01bd85c5f 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
@@ -226,7 +226,9 @@ protected function doTestResponsiveImageFieldFormatters($scheme, $empty_styles =
         'responsive_image_style' => 'style_one',
       ],
     ];
-    $display = entity_get_display('node', 'article', 'default');
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display = $display_repository->getViewDisplay('node', 'article');
     $display->setComponent($field_name, $display_options)
       ->save();
 
@@ -240,7 +242,7 @@ protected function doTestResponsiveImageFieldFormatters($scheme, $empty_styles =
         'responsive_image_style' => 'style_one',
       ],
     ];
-    $display = entity_get_display('node', 'article', 'default');
+    $display = $display_repository->getViewDisplay('node', 'article');
     $display->setComponent($field_name, $display_options)
       ->save();
 
@@ -383,7 +385,8 @@ public function testResponsiveImageFieldFormattersEmptyMediaQuery() {
         'responsive_image_style' => 'style_one',
       ],
     ];
-    $display = entity_get_display('node', 'article', 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article');
     $display->setComponent($field_name, $display_options)
       ->save();
 
@@ -431,7 +434,8 @@ public function testResponsiveImageFieldFormattersOneSource() {
         'responsive_image_style' => 'style_one',
       ],
     ];
-    $display = entity_get_display('node', 'article', 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'article');
     $display->setComponent($field_name, $display_options)
       ->save();
 
@@ -459,6 +463,9 @@ private function assertResponsiveImageFieldFormattersLink($link_type) {
     // Create a new node with an image attached.
     $test_image = current($this->getTestFiles('image'));
 
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Test the image linked to file formatter.
     $display_options = [
       'type' => 'responsive_image',
@@ -467,7 +474,7 @@ private function assertResponsiveImageFieldFormattersLink($link_type) {
         'responsive_image_style' => 'style_one',
       ],
     ];
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($field_name, $display_options)
       ->save();
     // Ensure that preview works.
@@ -488,7 +495,7 @@ private function assertResponsiveImageFieldFormattersLink($link_type) {
         'responsive_image_style' => 'style_one',
       ],
     ];
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($field_name, $display_options)
       ->save();
 
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index 92587b3628..6b3e3c4ab1 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -272,8 +272,11 @@ protected function createReferenceTestEntities($referenced_entity) {
         ],
       ],
     ])->save();
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     if (!$this->entity->getEntityType()->hasHandlerClass('view_builder')) {
-      entity_get_display($entity_type, $bundle, 'full')
+      $display_repository->getViewDisplay($entity_type, $bundle, 'full')
         ->setComponent($field_name, [
           'type' => 'entity_reference_label',
         ])
@@ -281,7 +284,7 @@ protected function createReferenceTestEntities($referenced_entity) {
     }
     else {
       $referenced_entity_view_mode = $this->selectViewMode($this->entity->getEntityTypeId());
-      entity_get_display($entity_type, $bundle, 'full')
+      $display_repository->getViewDisplay($entity_type, $bundle, 'full')
         ->setComponent($field_name, [
           'type' => 'entity_reference_entity_view',
           'settings' => [
@@ -497,7 +500,8 @@ public function testReferencedEntity() {
       // entities, but not for any other routes.
       $referenced_entity_view_mode = $this->selectViewMode($this->entity->getEntityTypeId());
       $this->pass("Test modification of referenced entity's '$referenced_entity_view_mode' display.", 'Debug');
-      $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $referenced_entity_view_mode);
+      $entity_display = \Drupal::service('entity_display.repository')
+        ->getViewDisplay($entity_type, $this->entity->bundle(), $referenced_entity_view_mode);
       $entity_display->save();
       $this->verifyPageCache($referencing_entity_url, 'MISS');
       $this->verifyPageCache($listing_url, 'MISS');
diff --git a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
index 69b35028a7..a3006b498b 100644
--- a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
@@ -73,7 +73,8 @@ public function testEntityUri() {
 
     // Verify that after modifying the entity's display, there is a cache miss.
     $this->pass("Test modification of entity's '$view_mode' display.", 'Debug');
-    $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $view_mode);
+    $entity_display = \Drupal::service('entity_display.repository')
+      ->getViewDisplay($entity_type, $this->entity->bundle(), $view_mode);
     $entity_display->save();
     $this->verifyPageCache($entity_url, 'MISS');
 
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install
index c796c9adcb..ffefe022f9 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.install
+++ b/core/modules/system/tests/modules/entity_test/entity_test.install
@@ -29,7 +29,8 @@ function entity_test_install() {
       'translatable' => FALSE,
     ])->save();
 
-    entity_get_form_display($entity_type, $entity_type, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $entity_type)
       ->setComponent('field_test_text', ['type' => 'text_textfield'])
       ->save();
   }
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
index 36d8d0670f..453af58fd5 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
@@ -265,8 +265,10 @@ protected function createReferenceTestEntities($referenced_entity) {
         ],
       ],
     ])->save();
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
     if (!$this->entity->getEntityType()->hasHandlerClass('view_builder')) {
-      entity_get_display($entity_type, $bundle, 'full')
+      $display_repository->getViewDisplay($entity_type, $bundle, 'full')
         ->setComponent($field_name, [
           'type' => 'entity_reference_label',
         ])
@@ -274,7 +276,7 @@ protected function createReferenceTestEntities($referenced_entity) {
     }
     else {
       $referenced_entity_view_mode = $this->selectViewMode($this->entity->getEntityTypeId());
-      entity_get_display($entity_type, $bundle, 'full')
+      $display_repository->getViewDisplay($entity_type, $bundle, 'full')
         ->setComponent($field_name, [
           'type' => 'entity_reference_entity_view',
           'settings' => [
@@ -490,7 +492,9 @@ public function testReferencedEntity() {
       // entities, but not for any other routes.
       $referenced_entity_view_mode = $this->selectViewMode($this->entity->getEntityTypeId());
       $this->pass("Test modification of referenced entity's '$referenced_entity_view_mode' display.", 'Debug');
-      $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $referenced_entity_view_mode);
+      /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+      $display_repository = \Drupal::service('entity_display.repository');
+      $entity_display = $display_repository->getViewDisplay($entity_type, $this->entity->bundle(), $referenced_entity_view_mode);
       $entity_display->save();
       $this->verifyPageCache($referencing_entity_url, 'MISS');
       $this->verifyPageCache($listing_url, 'MISS');
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
index bf8bcb337f..a413b73076 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
@@ -79,7 +79,7 @@ protected function runRevisionsTests($entity_type) {
     ]);
     $field->save();
 
-    entity_get_form_display($entity_type, $entity_type, 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay($entity_type, $entity_type, 'default')
       ->setComponent('translatable_test_field')
       ->save();
 
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
index 3637369753..3bbf9f98a0 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
@@ -85,7 +85,8 @@ public function testEntityViewController() {
    */
   public function testFieldItemAttributes() {
     // Make sure the test field will be rendered.
-    entity_get_display('entity_test', 'entity_test', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test')
       ->setComponent('field_test_text', ['type' => 'text_default'])
       ->save();
 
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php b/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
index 27f896b9a6..a102e6f794 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
@@ -66,7 +66,7 @@ public function testEntityUri() {
 
     // Verify that after modifying the entity's display, there is a cache miss.
     $this->pass("Test modification of entity's '$view_mode' display.", 'Debug');
-    $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $view_mode);
+    $entity_display = \Drupal::service('entity_display.repository')->getViewDisplay($entity_type, $this->entity->bundle(), $view_mode);
     $entity_display->save();
     $this->verifyPageCache($entity_url, 'MISS');
 
diff --git a/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php b/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php
index e35ac6d08a..8aa36f08bd 100644
--- a/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php
@@ -37,7 +37,8 @@ protected function setUp() {
       'bundle' => 'user',
       'label' => 'Test a multiple valued field',
     ])->save();
-    entity_get_form_display('user', 'user', 'register')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('user', 'user', 'register')
       ->setComponent('test_multiple', [
         'type' => 'text_textfield',
         'weight' => 0,
diff --git a/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php b/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php
index caf52094d5..5bbaa8b909 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php
@@ -78,7 +78,7 @@ public function testPreserveFormActionAfterAJAX() {
       'required' => TRUE,
     ])->save();
 
-    entity_get_form_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', 'page', 'default')
       ->setComponent($field_name, ['type' => 'text_textfield'])
       ->setComponent($field_file_name, ['type' => 'file_generic'])
       ->save();
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php b/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
index f6d41ae595..edb9dd9c02 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php
@@ -88,12 +88,14 @@ protected function setUpTermReferenceField() {
     $field_storage->setTranslatable(FALSE);
     $field_storage->save();
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->termFieldName, [
         'type' => 'entity_reference_autocomplete_tags',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->termFieldName, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php b/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
index e4490f3431..f0b31aa171 100644
--- a/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
@@ -39,7 +39,8 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', $field_name, 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'entity_reference_autocomplete_tags',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/RssTest.php b/core/modules/taxonomy/tests/src/Functional/RssTest.php
index 906109a4a3..00e380e048 100644
--- a/core/modules/taxonomy/tests/src/Functional/RssTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/RssTest.php
@@ -49,12 +49,15 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', $this->fieldName, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName, [
         'type' => 'options_select',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
index fc2fe62432..ba572be1c2 100644
--- a/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
@@ -58,13 +58,15 @@ protected function setUp() {
       'bundle' => $this->vocabulary->id(),
       'settings' => [],
     ])->save();
-    entity_get_display($entity_type, $this->vocabulary->id(), 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getViewDisplay($entity_type, $this->vocabulary->id())
       ->setComponent($name, [
         'type' => 'image',
         'settings' => [],
       ])
       ->save();
-    entity_get_form_display($entity_type, $this->vocabulary->id(), 'default')
+    $display_repository->getFormDisplay($entity_type, $this->vocabulary->id())
       ->setComponent($name, [
         'type' => 'image_image',
         'settings' => [],
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php
index 50a862473a..60861d6adb 100644
--- a/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php
@@ -82,12 +82,15 @@ protected function setUpTermReferenceField() {
     $field_storage->setTranslatable(FALSE);
     $field_storage->save();
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->termFieldName, [
         'type' => 'entity_reference_autocomplete_tags',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->termFieldName, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
index 64588c05f7..fb9b7e95c0 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
@@ -57,12 +57,14 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', $this->fieldName1, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName1, [
         'type' => 'options_select',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->fieldName1, [
         'type' => 'entity_reference_label',
       ])
@@ -71,12 +73,14 @@ protected function setUp() {
     $this->fieldName2 = mb_strtolower($this->randomMachineName());
     $this->createEntityReferenceField('node', 'article', $this->fieldName2, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName2, [
         'type' => 'options_select',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->fieldName2, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTest.php b/core/modules/taxonomy/tests/src/Functional/TermTest.php
index 83f7a22a97..7641a4849c 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTest.php
@@ -60,12 +60,14 @@ protected function setUp() {
     $this->createEntityReferenceField('node', 'article', $field_name, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
     $this->field = FieldConfig::loadByName('node', 'article', $field_name);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'options_select',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'entity_reference_label',
       ])
@@ -221,7 +223,8 @@ public function testTaxonomyNode() {
   public function testNodeTermCreationAndDeletion() {
     // Enable tags in the vocabulary.
     $field = $this->field;
-    entity_get_form_display($field->getTargetEntityTypeId(), $field->getTargetBundle(), 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($field->getTargetEntityTypeId(), $field->getTargetBundle())
       ->setComponent($field->getName(), [
         'type' => 'entity_reference_autocomplete_tags',
         'settings' => [
@@ -547,7 +550,8 @@ public function testTaxonomyGetTermByName() {
   public function testReSavingTags() {
     // Enable tags in the vocabulary.
     $field = $this->field;
-    entity_get_form_display($field->getTargetEntityTypeId(), $field->getTargetBundle(), 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($field->getTargetEntityTypeId(), $field->getTargetBundle())
       ->setComponent($field->getName(), [
         'type' => 'entity_reference_autocomplete_tags',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php
index 411ae5e496..227a589cc8 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php
@@ -91,7 +91,8 @@ public function testTermsTranslation() {
 
     // Set the display of the term reference field on the article content type
     // to "Check boxes/radio buttons".
-    entity_get_form_display('node', 'article', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', 'article')
       ->setComponent($this->termFieldName, [
         'type' => 'options_buttons',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php b/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php
index e62f72895c..3806820d2c 100644
--- a/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php
@@ -41,12 +41,14 @@ protected function setUp() {
     ];
     $this->createEntityReferenceField('node', 'article', $this->fieldName, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName, [
         'type' => 'options_select',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->fieldName, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
index 9f5791cd76..42bfc4989c 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
@@ -59,12 +59,14 @@ protected function setUp($import_test_views = TRUE) {
     ];
     $this->createEntityReferenceField('node', 'article', $this->fieldName1, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($this->fieldName1, [
         'type' => 'options_select',
       ])
       ->save();
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($this->fieldName1, [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php
index d22c109f9d..bd89619b7b 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTestBase.php
@@ -99,20 +99,22 @@ protected function mockStandardInstall() {
     ];
     $this->createEntityReferenceField('node', 'article', $field_name, 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'entity_reference_autocomplete_tags',
         'weight' => -4,
       ])
       ->save();
 
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent($field_name, [
         'type' => 'entity_reference_label',
         'weight' => 10,
       ])
       ->save();
-    entity_get_display('node', 'article', 'teaser')
+    $display_repository->getViewDisplay('node', 'article', 'teaser')
       ->setComponent($field_name, [
         'type' => 'entity_reference_label',
         'weight' => 10,
diff --git a/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php b/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
index 8d35181939..843bf4472b 100644
--- a/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
+++ b/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
@@ -54,7 +54,9 @@ protected function setUp() {
       'bundle' => 'article',
     ])->save();
 
-    entity_get_form_display('node', 'article', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', 'article')
       ->setComponent('field_telephone', [
         'type' => 'telephone_default',
         'settings' => [
@@ -63,7 +65,7 @@ protected function setUp() {
       ])
       ->save();
 
-    entity_get_display('node', 'article', 'default')
+    $display_repository->getViewDisplay('node', 'article')
       ->setComponent('field_telephone', [
         'type' => 'telephone_link',
         'weight' => 1,
diff --git a/core/modules/text/tests/src/Functional/TextFieldTest.php b/core/modules/text/tests/src/Functional/TextFieldTest.php
index ac01dd78a7..7e7ce2b5e2 100644
--- a/core/modules/text/tests/src/Functional/TextFieldTest.php
+++ b/core/modules/text/tests/src/Functional/TextFieldTest.php
@@ -104,7 +104,9 @@ public function testRequiredLongTextWithFileUpload() {
       'label' => $this->randomMachineName() . '_label',
     ])->save();
 
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($text_field_name, [
         'type' => 'text_textarea_with_summary',
       ])
@@ -112,7 +114,7 @@ public function testRequiredLongTextWithFileUpload() {
         'type' => 'file_generic',
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($text_field_name)
       ->setComponent($file_field_name)
       ->save();
@@ -166,12 +168,14 @@ public function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
       'bundle' => 'entity_test',
       'label' => $this->randomMachineName() . '_label',
     ])->save();
-    entity_get_form_display('entity_test', 'entity_test', 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('entity_test', 'entity_test')
       ->setComponent($field_name, [
         'type' => $widget_type,
       ])
       ->save();
-    entity_get_display('entity_test', 'entity_test', 'full')
+    $display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent($field_name)
       ->save();
 
@@ -202,7 +206,7 @@ public function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
 
     // Display the entity.
     $entity = EntityTest::load($id);
-    $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
+    $display = $display_repository->getViewDisplay($entity->getEntityTypeId(), $entity->bundle(), 'full');
     $content = $display->build($entity);
     $rendered_entity = \Drupal::service('renderer')->renderRoot($content);
     $this->assertNotContains($value, (string) $rendered_entity);
@@ -241,7 +245,7 @@ public function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     // Display the entity.
     $this->container->get('entity.manager')->getStorage('entity_test')->resetCache([$id]);
     $entity = EntityTest::load($id);
-    $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
+    $display = $display_repository->getViewDisplay($entity->getEntityTypeId(), $entity->bundle(), 'full');
     $content = $display->build($entity);
     $rendered_entity = \Drupal::service('renderer')->renderRoot($content);
     $this->assertContains($value, (string) $rendered_entity);
diff --git a/core/modules/user/tests/src/Functional/UserRegistrationTest.php b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
index 19ec4e3b09..c9a68328ad 100644
--- a/core/modules/user/tests/src/Functional/UserRegistrationTest.php
+++ b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
@@ -300,10 +300,14 @@ public function testRegistrationWithUserFields() {
       'required' => TRUE,
     ]);
     $field->save();
-    entity_get_form_display('user', 'user', 'default')
+
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
+    $display_repository->getFormDisplay('user', 'user')
       ->setComponent('test_user_field', ['type' => 'test_field_widget'])
       ->save();
-    entity_get_form_display('user', 'user', 'register')
+    $display_repository->getFormDisplay('user', 'user', 'register')
       ->save();
 
     // Check that the field does not appear on the registration form.
@@ -313,7 +317,7 @@ public function testRegistrationWithUserFields() {
     $this->assertCacheTag('config:user.settings');
 
     // Have the field appear on the registration form.
-    entity_get_form_display('user', 'user', 'register')
+    $display_repository->getFormDisplay('user', 'user', 'register')
       ->setComponent('test_user_field', ['type' => 'test_field_widget'])
       ->save();
 
diff --git a/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php b/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php
index 29306cd4d1..9f80094c09 100644
--- a/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php
+++ b/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php
@@ -62,10 +62,10 @@ public function testRegistrationWithUserFields() {
     ]);
     $field->save();
 
-    entity_get_form_display('user', 'user', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('user', 'user', 'default')
       ->setComponent('test_user_field', ['type' => 'test_field_widget'])
       ->save();
-    $user_registration_form = entity_get_form_display('user', 'user', 'register');
+    $user_registration_form = \Drupal::service('entity_display.repository')->getFormDisplay('user', 'user', 'register');
     $user_registration_form->save();
 
     // Check that the field does not appear on the registration form.
diff --git a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
index 54e0e3de31..0a8d674248 100644
--- a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
@@ -91,19 +91,21 @@ protected function setUp($import_test_views = TRUE) {
     ];
     $this->createEntityReferenceField('node', $this->nodeTypeWithTags->id(), $this->tagFieldName, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
-    entity_get_form_display('node', $this->nodeTypeWithTags->id(), 'default')
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+    $display_repository->getFormDisplay('node', $this->nodeTypeWithTags->id())
       ->setComponent($this->tagFieldName, [
         'type' => 'entity_reference_autocomplete_tags',
       ])
       ->save();
 
-    entity_get_display('node', $this->nodeTypeWithTags->id(), 'default')
+    $display_repository->getViewDisplay('node', $this->nodeTypeWithTags->id())
       ->setComponent($this->tagFieldName, [
         'type' => 'entity_reference_label',
         'weight' => 10,
       ])
       ->save();
-    entity_get_display('node', $this->nodeTypeWithTags->id(), 'teaser')
+    $display_repository->getViewDisplay('node', $this->nodeTypeWithTags->id(), 'teaser')
       ->setComponent('field_views_testing_tags', [
         'type' => 'entity_reference_label',
         'weight' => 10,
@@ -212,7 +214,8 @@ public function testTaggedWithByNodeType() {
         ],
       ],
     ])->save();
-    entity_get_form_display('node', $this->nodeTypeWithoutTags->id(), 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay('node', $this->nodeTypeWithoutTags->id())
       ->setComponent($this->tagFieldName, [
         'type' => 'entity_reference_autocomplete_tags',
       ])
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
index 902fa6894e..283223537c 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
@@ -42,7 +42,7 @@ protected function setUp() {
       'entity_type' => 'node',
       'bundle' => 'page',
     ])->save();
-    entity_get_form_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', 'page', 'default')
       ->setComponent($field_name, ['type' => 'text_textfield'])
       ->save();
 
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
index d0b9c2953f..a6423fa749 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
@@ -45,11 +45,14 @@ protected function setUp() {
    * Tests that the default autocomplete widget return the correct results.
    */
   public function testEntityReferenceAutocompleteWidget() {
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
+    $display_repository = \Drupal::service('entity_display.repository');
+
     // Create an entity reference field and use the default 'CONTAINS' match
     // operator.
     $field_name = 'field_test';
     $this->createEntityReferenceField('node', 'page', $field_name, $field_name, 'node', 'default', ['target_bundles' => ['page']]);
-    entity_get_form_display('node', 'page', 'default')
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent($field_name, [
         'type' => 'entity_reference_autocomplete',
         'settings' => [
@@ -75,7 +78,7 @@ public function testEntityReferenceAutocompleteWidget() {
     $assert_session->pageTextContains('Page test');
 
     // Now switch the autocomplete widget to the 'STARTS_WITH' match operator.
-    entity_get_form_display('node', 'page', 'default')
+    $display_repository->getFormDisplay('node', 'page')
       ->setComponent($field_name, [
         'type' => 'entity_reference_autocomplete',
         'settings' => [
diff --git a/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php b/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php
index 8faf8c6c91..58d0a50884 100644
--- a/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php
+++ b/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php
@@ -18,7 +18,7 @@
 class TimestampTest extends BrowserTestBase {
 
   /**
-   * An array of display options to pass to entity_get_display().
+   * An array of display options to pass to EntityDisplayRepositoryInterface::getViewDisplay().
    *
    * @var array
    */
diff --git a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php
index e8c8ae5e54..6c88599d8a 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php
@@ -62,7 +62,8 @@ protected function setUp() {
     ])
       ->save();
 
-    entity_get_form_display($this->entityTypeId, $this->entityTypeId, 'default')
+    \Drupal::service('entity_display.repository')
+      ->getFormDisplay($this->entityTypeId, $this->entityTypeId)
       ->setComponent($this->fieldName, ['type' => 'shape_only_color_editable_widget'])
       ->save();
   }
diff --git a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
index ad8b4383bd..3daa841d7c 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
@@ -112,7 +112,8 @@ protected function setUp() {
       'translatable' => FALSE,
     ])->save();
 
-    entity_get_form_display($this->entityTypeId, $this->entityTypeId, 'default')
+    $this->container->get('entity_display.repository')
+      ->getFormDisplay($this->entityTypeId, $this->entityTypeId, 'default')
       ->setComponent($this->fieldNameSingle, ['type' => 'test_field_widget'])
       ->setComponent($this->fieldNameMultiple, ['type' => 'test_field_widget'])
       ->setComponent($this->fieldNameFile, ['type' => 'file_generic'])
diff --git a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
index f82cbb425a..ba4ec2bea2 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
@@ -83,12 +83,12 @@ protected function setUp() {
     ]);
     $field->save();
 
-    entity_get_form_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')->getFormDisplay('node', 'page', 'default')
       ->setComponent('field_link', [
         'type' => 'link_default',
       ])
       ->save();
-    entity_get_display('node', 'page', 'full')
+    \Drupal::service('entity_display.repository')->getViewDisplay('node', 'page', 'full')
       ->setComponent('field_link', [
         'type' => 'link',
       ])
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php
new file mode 100644
index 0000000000..1bf3d10514
--- /dev/null
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php
@@ -0,0 +1,101 @@
+<?php
+
+namespace Drupal\KernelTests\Core\Entity;
+
+use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
+use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
+use Drupal\KernelTests\KernelTestBase;
+
+/**
+ * @coversDefaultClass \Drupal\Core\Entity\EntityDisplayRepository
+ *
+ * @group Entity
+ */
+class EntityDisplayRepositoryTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['user'];
+
+  /**
+   * The entity display repository under test.
+   *
+   * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
+   */
+  protected $displayRepository;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->displayRepository = \Drupal::service('entity_display.repository');
+
+    // Create a new view mode for users.
+    $this->container->get('entity_type.manager')
+      ->getStorage('entity_view_mode')
+      ->create([
+        'id' => 'user.pastafazoul',
+        'label' => $this->randomMachineName(),
+        'targetEntityType' => 'user',
+      ])
+      ->save();
+
+    // Create a new form mode for users.
+    $this->container->get('entity_type.manager')
+      ->getStorage('entity_form_mode')
+      ->create([
+        'id' => 'user.register',
+        'label' => $this->randomMachineName(),
+        'targetEntityType' => 'user',
+      ])
+      ->save();
+  }
+
+  /**
+   * @covers ::getViewDisplay
+   */
+  public function testViewDisplay() {
+    $display = $this->displayRepository->getViewDisplay('user', 'user');
+    $this->assertInstanceOf(EntityViewDisplayInterface::class, $display);
+    $this->assertTrue($display->isNew(), 'Default view display was created on demand.');
+    $this->assertSame(EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE, $display->getMode());
+
+    $display->createCopy('pastafazoul')->save();
+
+    $display = $this->displayRepository->getViewDisplay('user', 'user', 'pastafazoul');
+    $this->assertInstanceOf(EntityViewDisplayInterface::class, $display);
+    $this->assertFalse($display->isNew(), 'An existing view display was loaded.');
+    $this->assertSame('pastafazoul', $display->getMode());
+
+    $display = $this->displayRepository->getViewDisplay('user', 'user', 'magic');
+    $this->assertInstanceOf(EntityViewDisplayInterface::class, $display);
+    $this->assertTrue($display->isNew(), 'A new non-default view display was created on demand.');
+    $this->assertSame('magic', $display->getMode());
+  }
+
+  /**
+   * @covers ::getFormDisplay
+   */
+  public function testFormDisplay() {
+    $display = $this->displayRepository->getFormDisplay('user', 'user');
+    $this->assertInstanceOf(EntityFormDisplayInterface::class, $display);
+    $this->assertTrue($display->isNew(), 'Default form display was created on demand.');
+    $this->assertSame(EntityDisplayRepositoryInterface::DEFAULT_DISPLAY_MODE, $display->getMode());
+
+    $display->createCopy('register')->save();
+
+    $display = $this->displayRepository->getFormDisplay('user', 'user', 'register');
+    $this->assertInstanceOf(EntityFormDisplayInterface::class, $display);
+    $this->assertFalse($display->isNew(), 'An existing form display was loaded.');
+    $this->assertSame('register', $display->getMode());
+
+    $display = $this->displayRepository->getFormDisplay('user', 'user', 'magic');
+    $this->assertInstanceOf(EntityFormDisplayInterface::class, $display);
+    $this->assertTrue($display->isNew(), 'A new non-default form display was created on demand.');
+    $this->assertSame('magic', $display->getMode());
+  }
+
+}
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php
index ff13f6c2b2..1130611a9a 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityLegacyTest.php
@@ -2,10 +2,13 @@
 
 namespace Drupal\KernelTests\Core\Entity;
 
+use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\entity_test\Entity\EntityTestMul;
 use Drupal\KernelTests\KernelTestBase;
+use function entity_get_display;
 
 /**
  * Tests legacy entity functions.
@@ -51,4 +54,17 @@ public function testEntityLegacyCode() {
     $this->assertInstanceOf(EntityInterface::class, entity_load('entity_test', 1));
   }
 
+  /**
+   * @expectedDeprecation entity_get_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getViewDisplay() instead. See https://www.drupal.org/node/2835616
+   * @expectedDeprecation entity_get_form_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getFormDisplay() instead. See https://www.drupal.org/node/2835616
+   */
+  public function testLegacyDisplayFunctions() {
+    $view_display = entity_get_display('entity_test', 'entity_test', 'default');
+    $this->assertInstanceOf(EntityViewDisplayInterface::class, $view_display);
+    $this->assertEquals('entity_test.entity_test.default', $view_display->id());
+    $form_display = entity_get_form_display('entity_test', 'entity_test', 'default');
+    $this->assertInstanceOf(EntityFormDisplayInterface::class, $form_display);
+    $this->assertEquals('entity_test.entity_test.default', $form_display->id());
+  }
+
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
index bfc0aeaa41..68129909f3 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
@@ -100,10 +100,12 @@ public function testEntityViewBuilderCacheWithReferences() {
 
     // Create an entity reference field and an entity that will be referenced.
     $this->createEntityReferenceField('entity_test', 'entity_test', 'reference_field', 'Reference', 'entity_test');
-    entity_get_display('entity_test', 'entity_test', 'full')->setComponent('reference_field', [
-      'type' => 'entity_reference_entity_view',
-      'settings' => ['link' => FALSE],
-    ])->save();
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test', 'full')
+      ->setComponent('reference_field', [
+        'type' => 'entity_reference_entity_view',
+        'settings' => ['link' => FALSE],
+      ])->save();
     $entity_test_reference = $this->createTestEntity('entity_test');
     $entity_test_reference->save();
 
@@ -181,7 +183,8 @@ public function testEntityViewBuilderWeight() {
     $renderer = $this->container->get('renderer');
 
     // Set a weight for the label component.
-    entity_get_display('entity_test', 'entity_test', 'full')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('entity_test', 'entity_test', 'full')
       ->setComponent('label', ['weight' => 20])
       ->save();
 
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php
index d3d5e5b1d4..bcb68469a4 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php
@@ -38,7 +38,8 @@ public function testValidation() {
     $entity = $this->container->get('entity_type.manager')
       ->getStorage($entity_type)
       ->create(['id' => 1, 'revision_id' => 1]);
-    $display = entity_get_form_display($entity_type, $entity_type, 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type, $entity_type);
     $form = [];
     $form_state = new FormState();
     $display->buildForm($entity, $form, $form_state);
@@ -71,7 +72,8 @@ public function testValidation() {
    */
   protected function getErrorsForEntity(EntityInterface $entity, $hidden_fields = []) {
     $entity_type_id = 'entity_test_composite_constraint';
-    $display = entity_get_form_display($entity_type_id, $entity_type_id, 'default');
+    $display = \Drupal::service('entity_display.repository')
+      ->getFormDisplay($entity_type_id, $entity_type_id);
 
     foreach ($hidden_fields as $hidden_field) {
       $display->removeComponent($hidden_field);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
index 7af10f5946..6721e5cb0b 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
@@ -100,7 +100,8 @@ protected function setUp() {
     ])->save();
 
     // Show on default display and teaser.
-    entity_get_display('node', 'page', 'default')
+    \Drupal::service('entity_display.repository')
+      ->getViewDisplay('node', 'page')
       ->setComponent('field_term', [
         'type' => 'entity_reference_label',
       ])
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
index e59528e51d..774ecd35aa 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
@@ -3,6 +3,8 @@
 namespace Drupal\Tests\Core\Entity;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
 use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
 use Drupal\Core\Entity\EntityFieldManager;
 use Drupal\Core\Entity\EntityInterface;
@@ -470,4 +472,26 @@ public function testGetActiveFieldStorageDefinitions() {
     $this->entityManager->getActiveFieldStorageDefinitions('entity_test');
   }
 
+  /**
+   * @covers ::getViewDisplay
+   *
+   * @expectedDeprecation EntityManager::getViewDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service('entity_display.repository')->getViewDisplay() instead.
+   */
+  public function testGetViewDisplay() {
+    $view_display = $this->prophesize(EntityViewDisplayInterface::class)->reveal();
+    $this->entityDisplayRepository->getViewDisplay('entity_test', 'bundle', 'default')->shouldBeCalled()->willReturn($view_display);
+    $this->assertInstanceOf(EntityViewDisplayInterface::class, $this->entityManager->getViewDisplay('entity_test', 'bundle', 'default'));
+  }
+
+  /**
+   * @covers ::getFormDisplay
+   *
+   * @expectedDeprecation EntityManager::getFormDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service('entity_display.repository')->getFormDisplay() instead.
+   */
+  public function testGetFormDisplay() {
+    $Form_display = $this->prophesize(EntityFormDisplayInterface::class)->reveal();
+    $this->entityDisplayRepository->getFormDisplay('entity_test', 'bundle', 'default')->shouldBeCalled()->willReturn($Form_display);
+    $this->assertInstanceOf(EntityFormDisplayInterface::class, $this->entityManager->getFormDisplay('entity_test', 'bundle', 'default'));
+  }
+
 }
