Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ properties:
- enum:
- apple,display-subsystem
- apple,t6031-display-subsystem
- apple,t8122-display-subsystem
- apple,t8132-display-subsystem
- const: apple,t8132-display-diagnostics
deprecated: true
Expand Down Expand Up @@ -50,6 +51,15 @@ properties:
type: boolean
description: The loader validated the inherited J713 SID0 scanout mapping.

apple,dma-range:
$ref: /schemas/types.yaml#/definitions/uint64-array
minItems: 2
maxItems: 2
description:
Common scanout DMA aperture, encoded as a base and nonzero size. This
overrides the default aperture of each referenced DART stream. Other
consumers of the same DART retain their own apertures.

required:
- compatible
- iommus
Expand Down
19 changes: 16 additions & 3 deletions Documentation/networking/device_drivers/wifi/mt7932-neo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ fallback reason and the result of each lookup.
Station security
----------------

The driver advertises PSK, PSK-SHA256, SAE and OWE with CCMP, plus
BIP-CMAC-128 for management protection. Firmware performs SAE
The driver advertises PSK, PSK-SHA256, SAE and OWE with CCMP as the pairwise
cipher, plus BIP-CMAC-128 for management protection. PSK also accepts a TKIP
group key, described below. Firmware performs SAE
authentication and the four-way handshake and owns PTK, GTK and IGTK;
there is no host key-install interface or external-auth exchange.

Expand Down Expand Up @@ -151,9 +152,21 @@ follows the AP's RSN capabilities; it is not a firmware readback. Selectors
The standard SAE PWE settings (unspecified, hunting-and-pecking,
hash-to-element and both) are accepted; firmware chooses the exchange without
a host PWE field. Exact PWE policy behavior on 2.4 and 5 GHz still needs
qualification. SAE-PK, SAE-EXT-KEY and additional ciphers are not advertised. OWE and
qualification. SAE-PK and SAE-EXT-KEY are not advertised. OWE and
6 GHz support are described below.

TKIP is registered so that WPA2-PSK can join a WPA/WPA2 mixed-mode access point,
which pairs a CCMP unicast key with a TKIP group key. Pairwise TKIP, WPA1, and a
TKIP group key with SAE or OWE are refused. Firmware owns the TKIP group key like
any other. MIC failure reporting and TKIP countermeasures are left to firmware and
have not been verified: firmware runs the four-way handshake, so the host has no
KCK and calling ``cfg80211_michael_mic_failure()`` would do nothing.

J700 hardware testing joined one mixed-mode router on 2.4 and 5 GHz, and stayed
connected to a hostapd access point through 14 group rekeys at 60 second intervals
with ARP and mDNS still received. DHCP renewal, IPv6 router advertisements and a
commercial access point's own rekey still need qualification.

J700 hardware testing with NetworkManager and wpa_supplicant on a PSK+SAE
transition network has confirmed, on 2.4 GHz channel 6 and 5 GHz channel 149:

Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/apple/t8122-dcp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
display: display-subsystem {
compatible = "apple,t8122-display-subsystem";
iommus = <&disp0_dart 0>;
/* Keep the inherited scanout alias when adding external streams. */
apple,dma-range = /bits/ 64 <0x10000000000 0x1000000000>;
status = "disabled";
};
};
Expand Down Expand Up @@ -112,6 +114,9 @@
/*
* External display processor: the boot loader only reserves its
* firmware, the driver starts it. DMA windows as on T8112.
* The display subsystem's stream 0 on dispext0_dart uses the display
* subsystem's own high scanout aperture; its PIODMA stream keeps the
* low window below.
*/
dispext0_dart: iommu@319304000 {
compatible = "apple,t8122-dart", "apple,t8110-dart";
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/apple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ obj-$(CONFIG_DRM_APPLE_PARSER_KUNIT_TEST) += afkv2-test.o
appledrm-$(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST) += parser-test.o
appledrm-$(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST) += hotplug-test.o
appledrm-$(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST) += v14-board-test.o
appledrm-$(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST) += v14-plane-test.o
appledrm-$(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST) += audio-no-sio-test.dtbo.o
16 changes: 6 additions & 10 deletions drivers/gpu/drm/apple/iomfb_v14_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "iomfb_v14_7.h"
#include "iomfb_v14_7_backlight.h"
#include "iomfb_v14_7_board.h"
#include "iomfb_v14_7_plane.h"
#include "iomfb_v14_7_link.h"
#include "iomfb_v14_7_swap.h"
#include "av.h"
Expand Down Expand Up @@ -3085,12 +3086,7 @@ int iomfb_v14_7_atomic_check(struct apple_dcp *dcp, struct drm_crtc *crtc,
if (fb->modifier != DRM_FORMAT_MOD_LINEAR || fb->offsets[0] ||
fb->pitches[0] < width * 4 || (fb->pitches[0] & 63))
return -EINVAL;
/* An external pipe may show the top-left of a larger framebuffer. */
if (p->src_x || p->src_y || p->crtc_x || p->crtc_y ||
p->src_w != width << 16 || p->src_h != height << 16 ||
p->crtc_w != width || p->crtc_h != height ||
(dcp->external ? fb->width < width || fb->height < height :
fb->width != width || fb->height != height))
if (!dcp_v14_plane_fits_mode(p, width, height, dcp->external))
return -EINVAL;
obj = drm_fb_dma_get_gem_obj(fb, 0);
if (!obj || !obj->dma_addr || (u64)fb->pitches[0] * height > obj->base.size)
Expand Down Expand Up @@ -3344,12 +3340,15 @@ void iomfb_v14_7_flush(struct apple_dcp *dcp, struct drm_crtc *crtc,
struct drm_plane_state *p = drm_atomic_get_new_plane_state(state, crtc->primary);
struct drm_crtc_state *cs = drm_atomic_get_new_crtc_state(state, crtc);
struct drm_framebuffer *fb;
u32 width = 0, height = 0;

if (!p)
p = crtc->primary->state;
if (!cs)
cs = crtc->state;
fb = p && p->visible ? p->fb : NULL;
if (fb)
dcp_v14_plane_scanout_size(p, dcp->external, &width, &height);
/*
* No swaps while an external display is off, unset, unplugged, or
* being described again.
Expand All @@ -3364,10 +3363,7 @@ void iomfb_v14_7_flush(struct apple_dcp *dcp, struct drm_crtc *crtc,
if (!dcp->external)
dcp_v14_configure_backlight(dcp);
dcp->swap_start = ktime_get();
if (dcp->v14 && dcp_v14_present(dcp->v14, fb,
fb ? (dcp->external ? p->src_w >> 16 : fb->width) : 0,
fb ? (dcp->external ? p->src_h >> 16 : fb->height) : 0,
dcp->notch_height, cs)) {
if (dcp->v14 && dcp_v14_present(dcp->v14, fb, width, height, dcp->notch_height, cs)) {
dcp_drm_crtc_page_flip(dcp, ktime_get());
/*
* The swap completed: the framebuffers this commit and earlier
Expand Down
65 changes: 65 additions & 0 deletions drivers/gpu/drm/apple/iomfb_v14_7_plane.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */

#ifndef __APPLE_IOMFB_V14_7_PLANE_H__
#define __APPLE_IOMFB_V14_7_PLANE_H__

#include <linux/types.h>

#include <drm/drm_framebuffer.h>
#include <drm/drm_plane.h>
#include <drm/drm_rect.h>

/*
* The 14.7 presenter scans out one unscaled image of the mode's size from
* the top-left corner of the framebuffer. Judge a plane by its clipped
* rectangles, which drm_atomic_helper_check_plane_state() has set by the
* time the CRTC is checked: a plane that reaches past the right or bottom
* edge of the mode is clipped there, and what remains is exactly what the
* presenter scans out. Compositors put up such planes, for example when they
* centre a mirrored output and round its borders up on both sides.
*
* A plane that starts left of or above the mode, or that is scaled, starts
* its clipped source inside the framebuffer or differs in size from the
* mode, which the presenter cannot show. Clipping rounds the source toward
* 1:1, so a plane that reaches past the edge with a source less than a pixel
* off unscaled may clip to exactly the mode's size; it is then taken and
* shown unscaled.
*
* An external pipe may show the top-left of a larger framebuffer; the panel
* takes only a framebuffer of its mode's size.
*/
static inline bool dcp_v14_plane_fits_mode(const struct drm_plane_state *p,
u32 width, u32 height, bool external)
{
const struct drm_framebuffer *fb = p->fb;

if (p->src.x1 || p->src.y1 || p->dst.x1 || p->dst.y1)
return false;
if (drm_rect_width(&p->src) != (int)(width << 16) ||
drm_rect_height(&p->src) != (int)(height << 16) ||
drm_rect_width(&p->dst) != (int)width ||
drm_rect_height(&p->dst) != (int)height)
return false;
if (external)
return fb->width >= width && fb->height >= height;
return fb->width == width && fb->height == height;
}

/*
* The size of the image the presenter scans out for a visible plane that
* dcp_v14_plane_fits_mode() took: its clipped source on an external pipe,
* where the framebuffer may be larger, and the framebuffer on the panel.
*/
static inline void dcp_v14_plane_scanout_size(const struct drm_plane_state *p,
bool external, u32 *width, u32 *height)
{
if (external) {
*width = drm_rect_width(&p->src) >> 16;
*height = drm_rect_height(&p->src) >> 16;
} else {
*width = p->fb->width;
*height = p->fb->height;
}
}

#endif /* __APPLE_IOMFB_V14_7_PLANE_H__ */
146 changes: 146 additions & 0 deletions drivers/gpu/drm/apple/v14-plane-test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/*
* Which primary planes the 14.7 presenter takes: one unscaled image of the
* mode's size from the top-left of the framebuffer, judged on the rectangles
* drm_atomic_helper_check_plane_state() clips to the mode, with the scaling
* limits apple_plane_atomic_check() passes it. A plane that reaches past the
* right or bottom edge of the mode is clipped there and taken; one that is
* offset into the mode, starts left of or above it, or is scaled is not. For
* a plane it takes, check the size iomfb_v14_7_flush() hands the presenter.
*/
#include <kunit/test.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h>
#include <drm/drm_crtc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_modes.h>
#include <drm/drm_plane.h>
#include <drm/drm_rect.h>

#include "iomfb_v14_7_plane.h"

struct v14_plane_case {
const char *name;
u16 hdisplay, vdisplay; /* the mode */
u32 fb_w, fb_h;
int crtc_x, crtc_y;
u32 crtc_w, crtc_h;
u32 src_x, src_y, src_w, src_h; /* whole pixels */
bool external;
bool fits;
u32 shown_w, shown_h; /* clipped source, when it fits */
u32 src_w_frac; /* 16.16 fraction added to src_w */
};

static const struct v14_plane_case v14_plane_cases[] = {
{ "external, exact", 1920, 1080, 1920, 1080, 0, 0, 1920, 1080,
0, 0, 1920, 1080, true, true, 1920, 1080 },
/*
* KWin mirroring a 3024x1964 panel at scale 1.7 onto a 1920x1080
* display: 1663 columns of picture and 129 of border on each side.
*/
{ "external, one column past the right edge", 1920, 1080, 1921, 1080,
0, 0, 1921, 1080, 0, 0, 1921, 1080, true, true, 1920, 1080 },
{ "external, one row past the bottom edge", 1920, 1080, 1920, 1081,
0, 0, 1920, 1081, 0, 0, 1920, 1081, true, true, 1920, 1080 },
{ "external, past the right and bottom edges", 1920, 1080, 1921, 1081,
0, 0, 1921, 1081, 0, 0, 1921, 1081, true, true, 1920, 1080 },
/*
* Clipping rounds the source toward 1:1: 1921 + 1/65536 columns on
* 1921 clip to exactly 1920 << 16, while 1921.5 on 1921 clip to
* (1920 << 16) + 32750, which is scaled.
*/
{ "external, past the edge, source a 65536th over 1:1", 1920, 1080,
1922, 1080, 0, 0, 1921, 1080, 0, 0, 1921, 1080, true, true,
1920, 1080, .src_w_frac = 1 },
{ "external, past the edge, source half a pixel over 1:1", 1920, 1080,
1922, 1080, 0, 0, 1921, 1080, 0, 0, 1921, 1080, true, false,
.src_w_frac = 0x8000 },
{ "external, top-left of a larger framebuffer", 1920, 1080, 2560, 1440,
0, 0, 1920, 1080, 0, 0, 1920, 1080, true, true, 1920, 1080 },
{ "external, starts left of the mode", 1920, 1080, 1921, 1080,
-1, 0, 1921, 1080, 0, 0, 1921, 1080, true, false },
{ "external, starts above the mode", 1920, 1080, 1920, 1081,
0, -1, 1920, 1081, 0, 0, 1920, 1081, true, false },
{ "external, offset into the framebuffer", 1920, 1080, 1921, 1080,
0, 0, 1920, 1080, 1, 0, 1920, 1080, true, false },
{ "external, scaled to the mode", 1920, 1080, 1921, 1080,
0, 0, 1920, 1080, 0, 0, 1921, 1080, true, false },
{ "external, narrower than the mode", 1920, 1080, 1919, 1080,
0, 0, 1919, 1080, 0, 0, 1919, 1080, true, false },
{ "external, positioned inside the mode", 1920, 1080, 1920, 1080,
1, 0, 1919, 1080, 0, 0, 1919, 1080, true, false },
{ "panel, exact", 3024, 1964, 3024, 1964, 0, 0, 3024, 1964,
0, 0, 3024, 1964, false, true, 3024, 1964 },
{ "panel, larger framebuffer", 3024, 1964, 3025, 1964, 0, 0, 3025, 1964,
0, 0, 3025, 1964, false, false },
};

static void v14_plane_case_desc(const struct v14_plane_case *c, char *desc)
{
strscpy(desc, c->name, KUNIT_PARAM_DESC_SIZE);
}

KUNIT_ARRAY_PARAM(v14_plane, v14_plane_cases, v14_plane_case_desc);

static void v14_plane_fits_mode(struct kunit *test)
{
const struct v14_plane_case *c = test->param_value;
struct drm_plane *plane = kunit_kzalloc(test, sizeof(*plane), GFP_KERNEL);
struct drm_crtc *crtc = kunit_kzalloc(test, sizeof(*crtc), GFP_KERNEL);
struct drm_framebuffer *fb = kunit_kzalloc(test, sizeof(*fb), GFP_KERNEL);
struct drm_crtc_state *crtc_state =
kunit_kzalloc(test, sizeof(*crtc_state), GFP_KERNEL);
struct drm_plane_state p;
u32 shown_w, shown_h;
int ret;

KUNIT_ASSERT_NOT_NULL(test, plane);
KUNIT_ASSERT_NOT_NULL(test, crtc);
KUNIT_ASSERT_NOT_NULL(test, fb);
KUNIT_ASSERT_NOT_NULL(test, crtc_state);
fb->width = c->fb_w;
fb->height = c->fb_h;
crtc_state->crtc = crtc;
crtc_state->enable = true;
crtc_state->mode.hdisplay = c->hdisplay;
crtc_state->mode.vdisplay = c->vdisplay;
p = (struct drm_plane_state) {
.plane = plane, .crtc = crtc, .fb = fb,
.rotation = DRM_MODE_ROTATE_0,
.crtc_x = c->crtc_x, .crtc_y = c->crtc_y,
.crtc_w = c->crtc_w, .crtc_h = c->crtc_h,
.src_x = c->src_x << 16, .src_y = c->src_y << 16,
.src_w = (c->src_w << 16) + c->src_w_frac,
.src_h = c->src_h << 16,
};
/* As apple_plane_atomic_check() runs it, before the CRTC is checked. */
ret = drm_atomic_helper_check_plane_state(&p, crtc_state,
DRM_PLANE_NO_SCALING / 2,
DRM_PLANE_NO_SCALING * 4,
true, true);
KUNIT_ASSERT_EQ(test, ret, 0);
KUNIT_ASSERT_TRUE(test, p.visible);

KUNIT_EXPECT_EQ(test, dcp_v14_plane_fits_mode(&p, c->hdisplay, c->vdisplay,
c->external), c->fits);
if (!c->fits)
return;
/* What iomfb_v14_7_flush() hands the presenter. */
dcp_v14_plane_scanout_size(&p, c->external, &shown_w, &shown_h);
KUNIT_EXPECT_EQ(test, shown_w, c->shown_w);
KUNIT_EXPECT_EQ(test, shown_h, c->shown_h);
}

static struct kunit_case v14_plane_test_cases[] = {
KUNIT_CASE_PARAM(v14_plane_fits_mode, v14_plane_gen_params),
{}
};

static struct kunit_suite v14_plane_test_suite = {
.name = "apple-dcp-v14-plane",
.test_cases = v14_plane_test_cases,
};

kunit_test_suite(v14_plane_test_suite);
5 changes: 4 additions & 1 deletion drivers/gpu/drm/asahi/g15/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ impl platform::Driver for Driver<'_> {
// after probe_g15 started firmware would return an unbound device.
try_pin_init!(Driver {
_driver: {
// Not EPROBE_DEFER: a deferred device stays listed in devices_deferred until the
// deferred-probe work runs, even after activate()'s probe fails for good. Activation
// reprobes every unbound device; a device added later sees MODULE_READY set.
if !MODULE_READY.load(Ordering::Acquire) {
return Err(EPROBE_DEFER);
return Err(ENODEV);
}
let cfg = *info.ok_or(ENODEV)?;
dev_info!(pdev.as_ref(), "G15: probing ({})\n", cfg.name);
Expand Down
Loading
Loading