<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGDisplayPrimaryDisplay(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGDisplayPrimaryDisplay"
  },
  "title" : "CGDisplayPrimaryDisplay(_:)"
}
-->

# CGDisplayPrimaryDisplay(_:)

Returns the primary display in a hardware mirroring set.

```
func CGDisplayPrimaryDisplay(_ display: CGDirectDisplayID) -> CGDirectDisplayID
```

## Parameters

`display`

The identifier of a display in a hardware mirror set.

## Return Value

The primary display in the mirror set. If `display` is not hardware-mirrored, this function simply returns `display`.

## Discussion

In hardware mirroring, the contents of a single framebuffer are rendered in two or more displays simultaneously. The mirrored displays are said to be in a *hardware mirroring set*.

At the discretion of the device driver, one of the displays in a hardware mirroring set is designated as the *primary* display. The device driver binds the drawing engine, hardware accelerator, and 3D engine to the primary display and directs all drawing operations to this display.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)