first and last commit

This commit is contained in:
Chris Nutter committed 2023-07-08 13:03:17 -07:00
commit 1bf4efd552
2612 files changed
+636500

No files matched your search

+325
View File
@@ -0,0 +1,325 @@
/*
* Copyright (C) 2009-2015 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#include "adfe_regs.h"
#include <debug.h>
#include <drivers/display.h>
#include <lib/env.h>
#include <lib/paint.h>
#include <platform.h>
#include <platform/chipid.h>
#include <platform/clocks.h>
#include <platform/int.h>
#include <platform/memmap.h>
#include <platform/soc/hwclocks.h>
#include <platform/soc/hwisr.h>
#include <sys.h>
#include <sys/task.h>
#include <drivers/adfe/adfe.h>
/* Display Tunables structures */
struct adfe_v1_tuneable {
char *name;
uint32_t disp_dpcclkcntl[2];
uint32_t disp_dpbclklvl_clock_off_level[2];
uint32_t disp_dpbclklvl_clock_on_level[2];
uint32_t disp_dpusrcstrd[2];
uint32_t disp_dpcqoscnfg[2];
uint32_t disp_dpbqoslvl_med_watermark[2];
uint32_t disp_dpbqoslvl_high_watermark[2];
uint32_t disp_dpureqcfg[2];
uint32_t disp_dpvreqcfg[2];
uint32_t disp_dpvsrcstrd[2];
uint32_t disp_dpcwbstrd[2];
};
#include <platform/soc/display.h>
#ifndef DISP_VERSION
#error DISP_VERSION undefined
#endif
static struct adfe_v1_tuneable *adfe_tuneables_info;
static const int32_t adfe_tuneables_list_size = sizeof(adfe_tuneables) / sizeof(struct adfe_v1_tuneable);
static void adfe_irq_handler(void *arg)
{
int which = (int)arg;
dprintf(DEBUG_INFO, "adfe_irq_handler: DPCIRQ(%d) is 0x%x -- attempting to clear\n", which, rDPCIRQ);
rDPCIRQ = rDPCIRQ;
}
void adfe_init(struct display_timing *timing)
{
const char *env;
int32_t cnt;
env = env_get("adfe-tunables");
if (env == 0) env = "default";
for (cnt = 0; cnt < adfe_tuneables_list_size; cnt++) {
if (strcmp(env, adfe_tuneables[cnt].name)) continue;
adfe_tuneables_info = adfe_tuneables + cnt;
}
if (adfe_tuneables_info == 0) {
dprintf(DEBUG_INFO, "Failed to find adfe tunables info, bailing adfe_init()\n");
return;
}
adfe_enable_error_handler();
#if DISP_VERSION < 5
// Turn on AutoMode
rDPCPFDMA |= DPCPFDMA_AUTOMODE;
// Set FIFO DMA Burst Size to 2 Words
rDPCPFDMA = (rDPCPFDMA & ~DPCPFDMA_BURSTSIZE_MASK) | DPCPFDMA_BURSTSIZE_2WORDS;
// Set FIFO DMA Water Mark to 0x400
rDPCPFDMA = (rDPCPFDMA & ~DPCPFDMA_WATERMARK_MASK) | DPCPFDMA_WATERMARK(0x400);
#else
// Turn on AutoMode
rDPCPFMODE = DPCPFMODE_AUTOEN;
#endif
// Set screen size
rDPCSIZE = (timing->h_active << 16) | (timing->v_active << 0);
// Set the blend layer clock gating on level based on which adfe
#ifdef DISP0_BASE_ADDR
if (DISPLAYPIPE_BASE_ADDR == DISP0_BASE_ADDR) {
rDPBCLKLVL =
adfe_tuneables_info->disp_dpbclklvl_clock_off_level[0] |
adfe_tuneables_info->disp_dpbclklvl_clock_on_level[0];
} else
#endif
#ifdef DISP1_BASE_ADDR
if (DISPLAYPIPE_BASE_ADDR == DISP1_BASE_ADDR) {
rDPBCLKLVL =
adfe_tuneables_info->disp_dpbclklvl_clock_off_level[1] |
adfe_tuneables_info->disp_dpbclklvl_clock_on_level[1];
} else
#endif
panic("adfe_init: unsupported adfe_base_addr: %p", (void *)DISPLAYPIPE_BASE_ADDR);
#if (DISP_VERSION < 3)
// Set blend layer panic level to 0x90
rDPBPANLVL = 0x90;
// Enable memory panic for blender with 5000 cycle delay
rDPCPANCNFG = DPCPANCNFG_PANENAB | DPCPANCNFG_PANBENAB | DPCPANCNFG_PANTIMER(5000);
#else
#ifdef DISP0_BASE_ADDR
if (DISPLAYPIPE_BASE_ADDR == DISP0_BASE_ADDR) {
// Set the blend QOS level
rDPBQOSLVL =
adfe_tuneables_info->disp_dpbqoslvl_med_watermark[0] |
adfe_tuneables_info->disp_dpbqoslvl_high_watermark[0];
// Enable memory panic
rDPCQOSCNFG = adfe_tuneables_info->disp_dpcqoscnfg[0];
} else
#endif
#ifdef DISP1_BASE_ADDR
if (DISPLAYPIPE_BASE_ADDR == DISP1_BASE_ADDR) {
// Set the blend QOS level
rDPBQOSLVL =
adfe_tuneables_info->disp_dpbqoslvl_med_watermark[1] |
adfe_tuneables_info->disp_dpbqoslvl_high_watermark[1];
// Enable memory panic
rDPCQOSCNFG = adfe_tuneables_info->disp_dpcqoscnfg[1];
} else
#endif
panic("adfe_init: unsupported adfe_base_addr: %p", (void *)DISPLAYPIPE_BASE_ADDR);
// Set the CSC to pass through
rDPBCSCCOEFR(0) = 0x1000;
rDPBCSCCOEFG(1) = 0x1000;
rDPBCSCCOEFB(2) = 0x1000;
#endif
#if 0
// Enable clock gating but not in U0, U1 or V
rDPCCLKCNTL = DPCCLKCNTL_GATEENAB;
#endif
#if (DISP_VERSION > 4)
uint32_t i;
#ifdef DISP0_BASE_ADDR
if (DISPLAYPIPE_BASE_ADDR == DISP0_BASE_ADDR) {
for (i = 0; i < 2; i ++) {
rDPCWBSTRD(i) = adfe_tuneables_info->disp_dpcwbstrd[0];
rDPUSRCSTRD(i) = adfe_tuneables_info->disp_dpusrcstrd[0];
rDPUREQCFG(i) = (rDPUREQCFG(i) & DPUREQCFG_CACHEHINT_MASK) | adfe_tuneables_info->disp_dpureqcfg[0];
}
for (i = 0; i < 3; i ++) {
rDPVREQCFG(i) = (rDPVREQCFG(i) & DPVREQCFG_CACHEHINT_MASK) | adfe_tuneables_info->disp_dpvreqcfg[0];
rDPVSRCSTRD(i) = adfe_tuneables_info->disp_dpvsrcstrd[0];
}
rDPCCLKCNTL = adfe_tuneables_info->disp_dpcclkcntl[0];
} else
#endif
#ifdef DISP1_BASE_ADDR
if (DISPLAYPIPE_BASE_ADDR == DISP1_BASE_ADDR) {
for (i = 0; i < 2; i ++) {
rDPCWBSTRD(i) = adfe_tuneables_info->disp_dpcwbstrd[1];
rDPUSRCSTRD(i) = adfe_tuneables_info->disp_dpusrcstrd[1];
rDPUREQCFG(i) = (rDPUREQCFG(i) & DPUREQCFG_CACHEHINT_MASK) | adfe_tuneables_info->disp_dpureqcfg[1];
}
for (i = 0; i < 3; i ++) {
rDPVREQCFG(i) = (rDPVREQCFG(i) & DPVREQCFG_CACHEHINT_MASK) | adfe_tuneables_info->disp_dpvreqcfg[1];
rDPVSRCSTRD(i) = adfe_tuneables_info->disp_dpvsrcstrd[1];
}
rDPCCLKCNTL = adfe_tuneables_info->disp_dpcclkcntl[1];
} else
#endif
panic("adfe_init: unsupported adfe_base_addr: %p", (void *)DISPLAYPIPE_BASE_ADDR);
#endif
// Set the blend pipe underrun color to red
rDPBUNDRCNFG = (2 << 30) | (0x3FF << 20);
}
void adfe_set_ui_layer(u_int32_t layer, enum colorspace color, struct plane *plane0, struct plane *plane1,
u_int32_t width, u_int32_t height)
{
uint32_t adfe_color;
addr_t base;
if (layer > 1) return;
RELEASE_ASSERT(plane0 != NULL);
base = (addr_t)(plane0->fb_virt);
switch (color) {
case CS_RGB565 :
adfe_color = 4;
break;
case CS_RGB888 :
adfe_color = 0;
break;
default:
panic("unsupported color 0x%x", color);
return;
}
// Set adfe color, no swap and linear frame buffer
rDPUSRCFMT(layer) = (adfe_color << 8) | (0 << 4) | (1 << 0);
// Set base address of this layer (lower 32 bits, in case of 64 bits address)
rDPUSRCBASE(layer) = (uint32_t)(base);
// Set stride bytes
uint32_t rmw = rDPUSRCSTRD(layer);
rmw &= ~DPUSRCSTRD_SRCSTRIDE_MASK;
rmw |= (plane0->stride & DPUSRCSTRD_SRCSTRIDE_MASK);
rDPUSRCSTRD(layer) = rmw;
#if (DISP_VERSION >= 3)
// Set the source scale region geometry
rDPUSRCXY(layer) = 0;
rDPUSRCWH(layer) = (width << 16) | (height << 0);
// Set the destination frame geometry
rDPUDSTXY(layer) = 0;
rDPUDSTWH(layer) = (width << 16) | (height << 0);
// Enable source active region 0
rDPUSRCRGN(layer) = (1 << 0);
#if (DISP_VERSION < 5)
// No MMU for UI requests
// This should not be done on DISP_VERSION >= 5, as it clears
// HighAddr.
rDPUMMUCNTL(layer) = 0;
#endif
// No scaling (init=0,0 step=1.0,1.0)
rDPUDDAINITX(layer) = 0;
rDPUDDAINITY(layer) = 0;
rDPUDDASTEPX(layer) = 0x100000;
rDPUDDASTEPY(layer) = 0x100000;
#endif
#if (DISP_VERSION > 4)
rDPUMMUCNTL(layer) = ((base >> 32) & 0xf) << 4;
#endif
// Set first region for the requested window
rDPUSRCSTRXY(layer, 0) = (0 << 16) | (0 << 0);
rDPUSRCENDXY(layer, 0) = (width << 16) | (height << 0);
// Set blend layer 1 to pass through layer 1
rDPBLAY1CNFG = (0xFF << 24) | (0xFF << 16) | (2 << 8) | (2 << 0);
#if (DISP_VERSION < 3)
// Set first region enabled
rDPUSRCRGNENAB(layer) = (1 << 0);
// Set ui layer fifo on / off levels to 0x20 / 0x60
rDPUCLKLVL(layer) = (0x20 << 16) | (0x60 << 0);
// Set ui layer panic level to 0x20
rDPUPANLVL(layer) = (0x20 << 0);
#endif
}
void adfe_enable_error_handler(void)
{
#if (DISP_VERSION < 5)
// Error handling not implemented before version 5.
#else
rDPCIRQENAB |= DPCIRQ_MSTRERR;
install_int_handler(INT_DISP0, adfe_irq_handler, 0);
unmask_int(INT_DISP0);
#endif
}
void adfe_disable_error_handler(void)
{
#if (DISP_VERSION < 5)
#else
rDPCIRQENAB &= ~DPCIRQ_MSTRERR;
mask_int(INT_DISP0);
#endif
}
void adfe_set_background_color(u_int32_t color)
{
rDPBBACKCOLOR = color;
}
void adfe_activate_window(void)
{
u_int32_t layer = 0;
if (layer > 1) return;
// Enable the requested layer
rDPCENAB |= (1 << (layer + 8));
#if (DISP_VERSION > 4)
// Enable VBI, its needed for AutoMode
rDPCENAB |= (1 << 0);
#endif
}
bool adfe_get_enable(void)
{
#if (DISP_VERSION < 5)
return (rDPCPFDMA & DPCPFDMA_AUTOMODE) != 0;
#else
return (rDPCIRQENAB & DPCIRQ_MSTRERR) != 0;
#endif
}
+172
View File
@@ -0,0 +1,172 @@
/*
* Copyright (C) 2009-2014 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __APPLE_DISPLAYPIPE_H
#define __APPLE_DISPLAYPIPE_H
#include <platform/soc/hwregbase.h>
#define rDPCVERSION (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1018))
#define rDPCSTATE (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x101C))
#define rDPCGO (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1020))
#define rDPCRESTART (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1024))
#define rDPCIRQENAB (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1028))
#define DPCIRQ_MSTRERR (1<<11)
#define rDPCIRQ (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x102C))
#define rDPCSIZE (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1030))
#define rDPCFRMCNT (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1034))
#define rDPCENAB (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1038))
#if DISP_VERSION < 5
#define rDPCPFTOP (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x103C))
#endif
#define rDPCPFSIZE (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1040))
#define rDPCPFSTAT (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1044))
#define rDPCPFHEAD (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1048))
#if DISP_VERSION < 5
#define rDPCPFDMA (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x104C))
#define DPCPFDMA_AUTOMODE (1 << 4)
#define DPCPFDMA_BURSTSIZE_1WORD (0 << 8)
#define DPCPFDMA_BURSTSIZE_2WORDS (1 << 8)
#define DPCPFDMA_BURSTSIZE_4WORDS (2 << 8)
#define DPCPFDMA_BURSTSIZE_8WORDS (3 << 8)
#define DPCPFDMA_BURSTSIZE_16WORDS (4 << 8)
#define DPCPFDMA_BURSTSIZE_MASK (7 << 8)
#define DPCPFDMA_WATERMARK(n) ((n) << 16)
#define DPCPFDMA_WATERMARK_MASK (0x7FF << 16)
#else
#define rDPCPFMODE (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x104C))
#define DPCPFMODE_WBEN (1 << 1)
#define DPCPFMODE_AUTOEN (1 << 0)
#endif
#define rDPCPFFLUSH (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1050))
#define rDPCCLKCNTL (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1054))
#define DPCCLKCNTL_FLOOR(n) ((n & 0xFFFF) << 16)
#define DPCCLKCNTL_PIPE_ENABLE (1 << 12)
#define DPCCLKCNTL_LB_ENABLE (1 << 8)
#define DPCCLKCNTL_V_ENABLE (1 << 4)
#define DPCCLKCNTL_GATEENAB (1 << 0)
#define rDPCMEMACC (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x1058))
#if (DISP_VERSION < 3)
#define rDPCPANCNFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x105C))
#define DPCPANCNFG_PANENAB (1 << 0)
#define DPCPANCNFG_PANU0ENAB (1 << 8)
#define DPCPANCNFG_PANU1ENAB (1 << 9)
#define DPCPANCNFG_PANVENAB (1 << 10)
#define DPCPANCNFG_PANBENAB (1 << 11)
#define DPCPANCNFG_PANTIMER(n) ((n) << 16)
#define DPCPANCNFG_PANTIMER_MASK (0xFFFF << 16)
#else
#define rDPCQOSCNFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x105C))
#define DPCQOSCNFG_QOS_ENABLE (1 << 0)
#define DPCQOSCNFG_UIFIFO_ENABLE (1 << 1)
#define DPCQOSCNFG_VIDFIFO_ENABLE (1 << 2)
#if (DISP_VERSION < 4)
#define DPCQOSCNFG_QOS_OPTIMISTIC (1 << 3)
#else
#define DPCQOSCNFG_QOS_OPTIMISTIC (1 << 4)
#endif
#define DPCQOSCNFG_PIPE_ENABLE (1 << 8)
#define DPCQOSCNFG_QOS_TIMER(n) ((n) << 16)
#endif
#if (DISP_VERSION > 4)
#define rDPCWBSTRD(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x4 * (n)) + 0x1068))
#define DPCWBSTRD_DSTBURST_1BLOCK (0 << 0)
#define DPCWBSTRD_DSTBURST_2BLOCKS (1 << 0)
#define DPCWBSTRD_DSTBURST_4BLOCKS (2 << 0)
#define DPCWBSTRD_DSTBURST_8BLOCKS (3 << 0)
#define DPCWBSTRD_DSTBURST_MASK (3 << 0)
#define DPCWBSTRD_DSTSTRIDE_MASK (~0x3F)
#endif
#define rDPBBACKCOLOR (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x203C))
#define rDPBLAY1CNFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2040))
#define rDPBLAY2CNFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2044))
#define rDPBLAY3CNFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2048))
#define rDPBCRCENAB (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x204C))
#define rDPBCRCDATA (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2050))
#define rDPBCRCSNAP (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2054))
#define rDPBOUTSIZE (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2058))
#define rDPBCLKLVL (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x205C))
#define DPBCLKLVL_OFFLVL(n) ((n) << 0)
#define DPBCLKLVL_ONLVL(n) ((n) << 16)
#define rDPBUNDRCNFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2064))
#if (DISP_VERSION < 3)
#define rDPBPANLVL (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2060))
#else
#define rDPBQOSLVL (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2060))
#define DPBQOSLVL_MED_WATERMARK(n) ((n) << 0)
#define DPBQOSLVL_HIGH_WATERMARK(n) ((n) << 16)
#define rDPBCSCCOEFR(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x4 * (n)) + 0x2068))
#define rDPBCSCCOEFG(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x4 * (n)) + 0x2074))
#define rDPBCSCCOEFB(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x4 * (n)) + 0x2080))
#define rDPBCSCCOFFR (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x208C))
#define rDPBCSCCOFFG (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2090))
#define rDPBCSCCOFFB (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x2094))
#endif
#if (DISP_VERSION > 4)
#define rDPVREQCFG(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x4 * (n)) + 0x3050))
#define DPVREQCFG_REQ_CNT(_n) ((_n) & 0xFF)
#define DPVREQCFG_CACHEHINT_MASK (7 << 8)
#endif
#define rDPVSRCSTRD(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x4 * (n)) + 0x3088))
#define DPVSRCSTRD_SRCBURST_1BLOCK (0 << 0)
#define DPVSRCSTRD_SRCBURST_2BLOCKS (1 << 0)
#define DPVSRCSTRD_SRCBURST_4BLOCKS (2 << 0)
#define DPVSRCSTRD_SRCBURST_8BLOCKS (3 << 0)
#define DPVSRCSTRD_SRCBURST_MASK (3 << 0)
#define DPVSRCSTRD_SRCSTRIDE_MASK (~0x3F)
#if (DISP_VERSION > 4)
#define rDPUREQCFG(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x403C))
#define DPUREQCFG_REQ_CNT(_n) ((_n) & 0xFF)
#define DPUREQCFG_CACHEHINT_MASK (7 << 8)
#endif
#define rDPUSRCFMT(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4040))
#define rDPUSRCBASE(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4044))
#define rDPUSRCSTRD(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4048))
#define DPUSRCSTRD_SRCBURST_1BLOCK (0 << 0)
#define DPUSRCSTRD_SRCBURST_2BLOCKS (1 << 0)
#define DPUSRCSTRD_SRCBURST_4BLOCKS (2 << 0)
#define DPUSRCSTRD_SRCBURST_8BLOCKS (3 << 0)
#define DPUSRCSTRD_SRCBURST_MASK (3 << 0)
#define DPUSRCSTRD_SRCSTRIDE_MASK (~0x3F)
#if (DISP_VERSION < 3)
#define rDPUSRCRGNENAB(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x404C))
#define rDPUOUTSIZE(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4070))
#define rDPUCLKLVL(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4074))
#define rDPUPANLVL(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4078))
#define rDPUSRCSTRXY(n, r) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4050 + (4 * (r))))
#define rDPUSRCENDXY(n, r) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4060 + (4 * (r))))
#else
#define rDPUSRCXY(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x404C))
#define rDPUSRCWH(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4050))
#define rDPUDSTXY(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4054))
#define rDPUDSTWH(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4058))
#define rDPUSRCRGN(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x405C))
#define rDPUSRCSTRXY(n, r) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4060 + (4 * (r))))
#define rDPUSRCENDXY(n, r) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4070 + (4 * (r))))
#define rDPUDDAINITX(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4080))
#define rDPUDDAINITY(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4084))
#define rDPUDDASTEPX(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4088))
#define rDPUDDASTEPY(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x408C))
#define rDPUMMUCNTL(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + (0x1000 * (n)) + 0x4090))
#endif
#define rDPCPERFCNTL (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x6008))
#define rDPCPERFSTAT (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x600C))
#define rDPCPERFCNFG(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x6010 + (4 * (n))))
#define rDPCPERFDATA(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x6020 + (4 * (n))))
#define rDPCPERFSNAP(n) (*(volatile u_int32_t *)(DISPLAYPIPE_BASE_ADDR + 0x6030 + (4 * (n))))
#endif /* ! __APPLE_DISPLAYPIPE_H */
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* This document is the property of Apple Inc.
* It is considered confidential and proprietary.
*
* This document may not be reproduced or transmitted in any form,
* in whole or in part, without the express written permission of
* Apple Inc.
*/
#ifndef __APPLE_DISPLAY_FRONTEND_H
#define __APPLE_DISPLAY_FRONTEND_H
void adfe_init(struct display_timing *timing);
void adfe_set_ui_layer(u_int32_t pixel_pipe, enum colorspace color, struct plane *plane0, struct plane *plane1, u_int32_t width, u_int32_t height);
void adfe_enable_error_handler(void);
void adfe_disable_error_handler(void);
void adfe_set_background_color(u_int32_t color);
void adfe_activate_window(void);
bool adfe_get_enable(void);
#endif /* __APPLE_DISPLAY_FRONTEND_H */
+18
View File
@@ -0,0 +1,18 @@
# Copyright (C) 2009-2012 Apple Inc. All rights reserved.
#
# This document is the property of Apple Inc.
# It is considered confidential and proprietary.
#
# This document may not be reproduced or transmitted in any form,
# in whole or in part, without the express written permission of
# Apple Inc.
#
LOCAL_DIR := $(GET_LOCAL_DIR)
OPTIONS += \
WITH_DFE_ADFE=1
ALL_OBJS += \
$(LOCAL_DIR)/adfe.o
GLOBAL_INCLUDES += $(LOCAL_DIR)/include