Skip to content
Merged
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
7 changes: 6 additions & 1 deletion arch/arm/boot/dts/apple/s5l8940x-k93.dts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@
};

/* iBoot's scanout, as it leaves it: landscape 1024x768 (the K93's
* panel is scanned out that way), read and verified on this board. */
* panel is scanned out that way), read and verified on this board.
* No "rotation" for simpledrm: this board's desktop is the landscape
* screen as it stands, upright with the Home button on the left, and
* the touchscreen (touchscreen-swapped-x-y) and the motion sensors'
* mount matrices below are in that screen's axes. A portrait desktop
* would be a rotation here together with those turned back. */
framebuffer0: framebuffer@9f6fc000 {
compatible = "simple-framebuffer";
reg = <0x9f6fc000 0x300000>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/apple/s5l8942x-p105.dts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
};

/*
* Display pipeline. simplefb above reuses the output of these
* Display pipeline. simpledrm above reuses the output of these
* blocks rather than reprogramming them; a real CLCD + MIPI-DSI
* driver for S5L8940X does not exist and is not needed to get a
* desktop on screen.
Expand Down
27 changes: 17 additions & 10 deletions arch/arm/boot/dts/apple/s5l8945x-ipad3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,24 @@
* tick before the AIC timer (init/main.c, patches/tree/0001).
*
* console=tty0 also sends the log to fbcon, which takes the
* panel over from j1fb when simplefb registers: the penguins and
* the log, portrait (fbcon=rotate:1, home button at the bottom;
* font:TER16x32 if the kernel has it, else fbcon's default).
* ttyGS0 stays last, so it is still /dev/console.
* panel over from j1fb when simpledrm registers its fbdev: the
* penguins and the log, portrait with the home button at the
* bottom, because simpledrm already presents the scanout upright
* (the framebuffer node's rotation), so fbcon is not turned
* itself (font:TER16x32 if the kernel has it, else fbcon's
* default). ttyGS0 stays last, so it is still /dev/console.
*
* simpledrm.zoom=2 here would present the desktop at 768 x 1024,
* each pixel copied as a 2 x 2 block: a quarter of the pixels to
* draw for a desktop without the GPU. Off by default.
*
* Both cores start at boot, the mini's way (platsmp.c). lpj is
* the 1 GHz A5's; the A5X is 1 GHz too.
* rdinit=/init is the initramfs linked into the zImage; an empty
* external initrd here would make the kernel look for a second
* archive.
*/
bootargs = "earlycon=j1fb console=tty0 console=ttyGS0,115200 fbcon=rotate:1,font:TER16x32 lpj=5000000 rdinit=/init panic=10 loglevel=8 ignore_loglevel g_cdc.host_addr=02:10:5a:31:00:01 g_cdc.dev_addr=02:10:5a:31:00:02";
bootargs = "earlycon=j1fb console=tty0 console=ttyGS0,115200 fbcon=font:TER16x32 lpj=5000000 rdinit=/init panic=10 loglevel=8 ignore_loglevel g_cdc.host_addr=02:10:5a:31:00:01 g_cdc.dev_addr=02:10:5a:31:00:02";
};

/*
Expand Down Expand Up @@ -103,10 +109,11 @@
/*
* The panel is portrait and scans out 2048 x 1536, turned:
* simpledrm presents 1536 x 2048 and turns each damaged
* rectangle as it copies it, so that compositors render
* unrotated. This is the turn fbcon=rotate:1 draws the console
* upright with: upright pixel (x, y) at scanout (2047 - y, x).
* The touchscreen's axes are already the upright ones.
* rectangle as it copies it, so that compositors and fbcon
* render unrotated: upright pixel (x, y) at scanout
* (2047 - y, x), the turn fbcon=rotate:1 used to draw on
* simplefb. The touchscreen's axes are already the upright
* ones.
*/
rotation = <90>;
};
Expand Down Expand Up @@ -534,7 +541,7 @@
* Display pipeline, recorded and left off. The mini's node
* here is MIPI-DSI. This ADT's panel is eDP (edp@9500000,
* max 4 lanes) fed by CLCD, with a highland-park block at
* 0xb020000 that the mini does not have. simplefb can reuse
* 0xb020000 that the mini does not have. simpledrm can reuse
* iBoot's scanout once its base is known; it cannot be copied
* from the mini's 768x1024 region at 0x9f6fc000.
*/
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/apple/s5l8955x-p101.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* The console is the USB gadget's ACM port (ttyGS0), as on the iPad 3:
* the Lightning connector carries no UART. console=tty0 also puts the log
* on iBoot's framebuffer once simplefb takes it. rdinit=/init is the
* on iBoot's framebuffer once simpledrm takes it. rdinit=/init is the
* initramfs that comes with the kernel.
*/

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/apple/s5l8955x-p102.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* The console is the USB gadget's ACM port (ttyGS0), as on the iPad 3:
* the Lightning connector carries no UART. console=tty0 also puts the log
* on iBoot's framebuffer once simplefb takes it. rdinit=/init is the
* on iBoot's framebuffer once simpledrm takes it. rdinit=/init is the
* initramfs that comes with the kernel.
*/

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/apple/s5l8955x-p103.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* The console is the USB gadget's ACM port (ttyGS0), as on the iPad 3:
* the Lightning connector carries no UART. console=tty0 also puts the log
* on iBoot's framebuffer once simplefb takes it. rdinit=/init is the
* on iBoot's framebuffer once simpledrm takes it. rdinit=/init is the
* initramfs that comes with the kernel.
*/

Expand Down
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/apple/s5l8955x.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,27 @@
* iBoot's scanout, kept running. m1n1 fills reg, width, height and
* stride from iBoot's boot arguments and enables it (dt_set_fb). The
* pixel order is not in the boot arguments; x8r8g8b8 is the A5X's.
*
* The panel is the iPad 3's: the same 2048 x 1536 Retina panel in the
* same housing, behind the same eDP block (the ADT's edp node is
* "edp,s5l8955x", "edp,s5l8945x"). On the iPad 3 iBoot scans it out
* landscape, 2048 x 1536, and simpledrm turns it upright (portrait,
* home button at the bottom) with rotation 90; the same is set here.
* If iBoot's boot arguments give a portrait size on this board (the
* kernel log's "scanout ... turned 90 degrees: presenting ..." line),
* this rotation is the one value to drop. The ADT's /chosen
* display-rotation is zero in the IPSW, filled by iBoot at boot.
*
* simpledrm.zoom=2 on the command line would present the desktop at
* half size (768 x 1024), each pixel copied as a 2 x 2 block, for a
* desktop without the GPU. Off by default.
*/
framebuffer0: framebuffer@0 {
compatible = "simple-framebuffer";
reg = <0x0 0x0>;
memory-region = <&fb_region>;
format = "x8r8g8b8";
rotation = <90>;
status = "disabled";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/orchard_applearmv7_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,12 @@ CONFIG_DRM_I2C_ADV7511=m
CONFIG_DRM_I2C_ADV7511_AUDIO=y
CONFIG_DRM_ETNAVIV=m
CONFIG_DRM_PL111=m
CONFIG_DRM_SIMPLEDRM=y
CONFIG_DRM_LIMA=m
CONFIG_DRM_APPLE_SGX=y
CONFIG_DRM_PANFROST=m
CONFIG_FB=y
CONFIG_FB_EFI=y
CONFIG_FB_SIMPLE=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_PWM=y
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-apple/j1_earlyfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* fbcon=rotate:1 does). The 8x8 font at scale 2 gives 96 columns by 128
* rows; it wraps to the top and clears the line ahead instead of scrolling.
*
* Once a framebuffer is registered (simplefb, a device_initcall) fbcon owns
* the panel -- with console=tty0 it redraws the log under the penguins --
* Once a framebuffer is registered (simpledrm's fbdev, from its probe at
* device_initcall) fbcon owns the panel -- with console=tty0 it redraws the log under the penguins --
* so this stops drawing there rather than at late_initcall.
*
* This runs before the kernel has any mapping for the panel, and while
Expand All @@ -22,7 +22,7 @@
*
* Everything here is __init on purpose. printk_late_init unregisters any
* boot console whose code is in init memory, so this hands the panel back
* (to simplefb/fbcon and userspace) at late_initcall time.
* (to simpledrm/fbcon and userspace) at late_initcall time.
*
* It used to be required: without it the J1 hung early in boot. That was
* the missing tick before the AIC timer (irq-apple-aic1.c,
Expand Down
17 changes: 13 additions & 4 deletions drivers/gpu/drm/apple-sgx/apple_sgx_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ static void blt_put_prog(struct apple_sgx *sgx, u32 va, const u64 *p, int n)
memcpy(sgx->blt_code + (va - SGX_BLT_CODE_VA) / 8, p, n * sizeof(*p));
}

/* The framebuffer simplefb drives, from the device tree. */
/* The framebuffer simpledrm drives, from the device tree. */
int apple_sgx_fb_find(struct apple_sgx *sgx, struct resource *res)
{
struct device_node *np, *mem;
Expand Down Expand Up @@ -2035,8 +2035,12 @@ static int sgx_fb_copy_safe(struct apple_sgx *sgx, u32 sx, u32 sy, u32 dx, u32 d
return ret;
}

/* fbcon on the GPU: simplefb's operations, with fills and copies replaced;
* whatever the engine cannot do goes back to simplefb's (CPU) versions. */
/* fbcon on the GPU: the framebuffer driver's operations, with fills and
* copies replaced; whatever the engine cannot do goes back to its (CPU)
* versions. Only a driver that draws straight into the boot framebuffer
* qualifies (simplefb did). simpledrm's fbdev draws into a shadow in system
* memory (smem_start 0) that it copies out itself, so with it fbcon stays on
* the CPU and this hook is not set. */
extern struct fb_info *registered_fb[FB_MAX]; /* fbmem.c; both built in */
static struct apple_sgx *sgx_fbcon;
static struct fb_ops sgx_fbcon_ops;
Expand Down Expand Up @@ -2065,8 +2069,13 @@ static void sgx_fbcon_hook(struct apple_sgx *sgx)
{
struct fb_info *info = registered_fb[0];

if (sgx->fb_hooked || !sgx->fb_w || !info || info->fix.smem_start != sgx->fb_pa)
if (sgx->fb_hooked || !sgx->fb_w || !info)
return;
if (info->fix.smem_start != sgx->fb_pa) {
dev_info(sgx->dev, "fbcon: %s does not draw into the boot framebuffer; fills and copies stay on the CPU\n",
info->fix.id);
return;
}
sgx_fbcon_cpu = info->fbops;
sgx_fbcon_ops = *info->fbops;
sgx_fbcon_ops.fb_fillrect = sgx_fbcon_fillrect;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/apple-sgx/apple_sgx_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Apple S5L8940X (A5) PowerVR SGX543MP2 -- the screen, through KMS.
*
* The display pipe is iBoot's: it scans out a framebuffer at a fixed
* physical address (the device tree's simple-framebuffer, which simplefb
* physical address (the device tree's simple-framebuffer, which simpledrm
* keeps for fbcon), and nothing here programs it. What is here is KMS on
* that memory, so that GBM, EGL and compositors have a screen: one plane,
* CRTC, encoder and connector, the framebuffer's one mode. A KMS
Expand Down
Loading