first and last commit
This commit is contained in:
commit
1bf4efd552
2612 files changed
+636500
No files matched your search
@@ -0,0 +1,264 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 <debug.h>
|
||||
#include <lib/env.h>
|
||||
#include <platform/soc/hwregbase.h>
|
||||
#include <drivers/dither.h>
|
||||
|
||||
#if DITHER_VERSION == 2
|
||||
#include "dither_v2.h"
|
||||
#elif DITHER_VERSION == 3
|
||||
#include "dither_v3.h"
|
||||
#else
|
||||
#include "dither_v4.h"
|
||||
#endif
|
||||
|
||||
#ifndef DITHER_BASE_ADDR
|
||||
#error "DITHER base addr for AppleDither Block is not defined"
|
||||
#endif
|
||||
|
||||
static uint8_t dither_type;
|
||||
|
||||
#if DITHER_VERSION == 4
|
||||
#ifndef TARGET_DITHER_INBITSREDUCTION
|
||||
#define TARGET_DITHER_INBITSREDUCTION 2
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_EDOUTTOSTINWIDTH
|
||||
#define TARGET_DITHER_EDOUTTOSTINWIDTH 3
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_DITHEROUTWIDTH
|
||||
#define TARGET_DITHER_DITHEROUTWIDTH 3
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_METHOD_MAX
|
||||
#define TARGET_DITHER_ST_METHOD_MAX 3
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_METHOD_POP
|
||||
#define TARGET_DITHER_ST_METHOD_POP 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_PHASE
|
||||
#define TARGET_DITHER_ST_PHASE 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC0
|
||||
#define TARGET_DITHER_ST_SKEWLOC0 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC1
|
||||
#define TARGET_DITHER_ST_SKEWLOC1 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC2
|
||||
#define TARGET_DITHER_ST_SKEWLOC2 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC3
|
||||
#define TARGET_DITHER_ST_SKEWLOC3 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC4
|
||||
#define TARGET_DITHER_ST_SKEWLOC4 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC5
|
||||
#define TARGET_DITHER_ST_SKEWLOC5 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC6
|
||||
#define TARGET_DITHER_ST_SKEWLOC6 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC7
|
||||
#define TARGET_DITHER_ST_SKEWLOC7 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC8
|
||||
#define TARGET_DITHER_ST_SKEWLOC8 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC9
|
||||
#define TARGET_DITHER_ST_SKEWLOC9 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC10
|
||||
#define TARGET_DITHER_ST_SKEWLOC10 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC11
|
||||
#define TARGET_DITHER_ST_SKEWLOC11 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC12
|
||||
#define TARGET_DITHER_ST_SKEWLOC12 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC13
|
||||
#define TARGET_DITHER_ST_SKEWLOC13 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_DITHER_ST_SKEWLOC14
|
||||
#define TARGET_DITHER_ST_SKEWLOC14 0
|
||||
#endif
|
||||
|
||||
void dither_init(uint32_t display_width, uint32_t display_height, uint32_t display_depth)
|
||||
#else
|
||||
void dither_init(uint32_t display_depth)
|
||||
#endif
|
||||
{
|
||||
//Fixing the value for now. When the request comes to use a Blue noise, please ask how to make
|
||||
//the decision: Based on Target or based on number of dithering bits
|
||||
dither_type = DITHER_SPATIO_TEMPORAL;
|
||||
|
||||
#ifdef TARGET_DITHER_TYPE
|
||||
dither_type = TARGET_DITHER_TYPE;
|
||||
#endif //TARGET_DITHER_TYPE
|
||||
|
||||
#if DITHER_VERSION == 2
|
||||
//Number of bits reduced by the dithering algorithm core.
|
||||
rDITHER_METHOD = (4 << 4) | ((display_depth <= 18) ? 0x3 : 0x2);
|
||||
rDITHER_BOOST_POP = (display_depth <= 18) ? 0x1 : 0x0;
|
||||
rDITHER_OUTPUT_WIDTH = (display_depth <=18) ? 0x0 : 0x1;
|
||||
#endif
|
||||
|
||||
#if DITHER_VERSION == 3
|
||||
switch(dither_type) {
|
||||
case DITHER_SPATIO_TEMPORAL:
|
||||
dprintf(DEBUG_SPEW, "Spatial_temporal Dither\n");
|
||||
//Bypass BN
|
||||
//<rdar://problem/11389221> [FPGA DEBUG]: Disabling certains backend blocks via ADBE0:MODE_CTL doesn't disable them
|
||||
rDITHER_BN_OP_CFG = (1 << 29);
|
||||
|
||||
rDITHER_ST_METHOD = (0x4 << 4);
|
||||
if (display_depth == 24)
|
||||
rDITHER_ST_METHOD |= (0x1 << 13) | (0x2 << 0);
|
||||
else if (display_depth <= 18)
|
||||
rDITHER_ST_METHOD |= (0x1 << 13) | (0x3 << 0);
|
||||
else
|
||||
panic("unexpected display depth");
|
||||
|
||||
break;
|
||||
|
||||
case DITHER_BLUE_NOISE:
|
||||
// Note: If bn_dither_enable is set and st_dither_enable is cleared, the
|
||||
// spatio/temporal dither stage must also be disabled internally
|
||||
// (see DITHER Register Spec.) by setting SPAT_TEMP_METHOD.mode to 0x4 and
|
||||
// SPAT_TEMP_METHOD.depth to 0x0
|
||||
dprintf(DEBUG_SPEW, "Blue_noise Dither\n");
|
||||
rDITHER_ST_METHOD |= (0x4 << 13);
|
||||
rDITHER_ST_METHOD &= ~(0xf); //clear depth
|
||||
rDITHER_BN_OP_CFG = 1;
|
||||
uint32_t thr_bit;
|
||||
switch(display_depth) {
|
||||
case 24:
|
||||
thr_bit = DITHER_BN_CONST_THR2BIT;
|
||||
break;
|
||||
case 18:
|
||||
thr_bit = DITHER_BN_CONST_THR4BIT;
|
||||
rDITHER_BN_OP_CFG |= (0x1 << 24) | (0x1 << 20) | (0x1 << 16);
|
||||
break;
|
||||
default:
|
||||
panic("unexpected display depth");
|
||||
}
|
||||
rDITHER_BN_CONST = (thr_bit << 16 | thr_bit << 8 | thr_bit << 0);
|
||||
break;
|
||||
|
||||
case DITHER_NONE:
|
||||
default:
|
||||
dprintf(DEBUG_SPEW, "%d is not a supported dithering type. Disabling dithering\n", dither_type);
|
||||
//bypassed and clock-gated if both st_dither_enable and bn_dither_enable are
|
||||
//cleared
|
||||
rDITHER_ST_METHOD = 0;
|
||||
rDITHER_BN_OP_CFG = (1 << 29);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DITHER_VERSION == 4
|
||||
rDITHER_ACTIVEREGIONSTART = 0 << 16 | 0; //Set active region start
|
||||
rDITHER_ACTIVEREGIONSIZE = display_height << 16 | display_width; //Set Active Region
|
||||
|
||||
// Setup for 8-bit panel with VRR
|
||||
rDITHER_INBITSREDUCTION = TARGET_DITHER_INBITSREDUCTION;
|
||||
rDITHER_EDOUTTOSTINWIDTH = TARGET_DITHER_EDOUTTOSTINWIDTH;
|
||||
rDITHER_DITHEROUTWIDTH = TARGET_DITHER_DITHEROUTWIDTH;
|
||||
|
||||
switch(dither_type) {
|
||||
case DITHER_SPATIO_TEMPORAL:
|
||||
dprintf(DEBUG_SPEW, "Spatial_temporal Dither\n");
|
||||
|
||||
rDITHER_ST_METHOD |= (TARGET_DITHER_ST_METHOD_MAX << 13) | (TARGET_DITHER_ST_METHOD_POP << 8);
|
||||
if (display_depth == 24)
|
||||
rDITHER_ST_METHOD |= (0x2 << 0);
|
||||
else if (display_depth <= 18)
|
||||
rDITHER_ST_METHOD |= (0x3 << 0);
|
||||
else
|
||||
panic("unexpected display depth");
|
||||
|
||||
rDITHER_ST_PHASE = TARGET_DITHER_ST_PHASE;
|
||||
rDITHER_ST_SKEWLOC0 = TARGET_DITHER_ST_SKEWLOC0;
|
||||
rDITHER_ST_SKEWLOC1 = TARGET_DITHER_ST_SKEWLOC1;
|
||||
rDITHER_ST_SKEWLOC2 = TARGET_DITHER_ST_SKEWLOC2;
|
||||
rDITHER_ST_SKEWLOC3 = TARGET_DITHER_ST_SKEWLOC3;
|
||||
rDITHER_ST_SKEWLOC4 = TARGET_DITHER_ST_SKEWLOC4;
|
||||
rDITHER_ST_SKEWLOC5 = TARGET_DITHER_ST_SKEWLOC5;
|
||||
rDITHER_ST_SKEWLOC6 = TARGET_DITHER_ST_SKEWLOC6;
|
||||
rDITHER_ST_SKEWLOC7 = TARGET_DITHER_ST_SKEWLOC7;
|
||||
rDITHER_ST_SKEWLOC8 = TARGET_DITHER_ST_SKEWLOC8;
|
||||
rDITHER_ST_SKEWLOC9 = TARGET_DITHER_ST_SKEWLOC9;
|
||||
rDITHER_ST_SKEWLOC10 = TARGET_DITHER_ST_SKEWLOC10;
|
||||
rDITHER_ST_SKEWLOC11 = TARGET_DITHER_ST_SKEWLOC11;
|
||||
rDITHER_ST_SKEWLOC12 = TARGET_DITHER_ST_SKEWLOC12;
|
||||
rDITHER_ST_SKEWLOC13 = TARGET_DITHER_ST_SKEWLOC13;
|
||||
rDITHER_ST_SKEWLOC14 = TARGET_DITHER_ST_SKEWLOC14;
|
||||
|
||||
rDITHER_ENABLE |= (1 << 1);
|
||||
break;
|
||||
|
||||
case DITHER_ERROR_DIFFUSION:
|
||||
dprintf(DEBUG_SPEW, "Error Diffusion Dither\n");
|
||||
|
||||
rDITHER_ED_THRESHOLDRED = (8192 << 2);
|
||||
rDITHER_ED_THRESHOLDGREEN = (8192 << 2);
|
||||
rDITHER_ED_THRESHOLDBLUE = (8192 << 2);
|
||||
|
||||
rDITHER_ENABLE |= (1 << 0);
|
||||
break;
|
||||
|
||||
case DITHER_NONE:
|
||||
default:
|
||||
dprintf(DEBUG_SPEW, "%d is not a supported dithering type. Disabling dithering\n", dither_type);
|
||||
//bypassed and clock-gated if both st_dither_enable and bn_dither_enable are
|
||||
//cleared
|
||||
rDITHER_ST_METHOD = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
//double buffer registers. force them to update
|
||||
rDITHER_UPDATECONTROL = DITHER_UPDATECONTROL_UPDATEENABLETIMING |
|
||||
DITHER_UPDATECONTROL_UPDATEREQTIMING ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void dither_set_enable(bool enable)
|
||||
{
|
||||
#if DITHER_VERSION == 2
|
||||
if (enable) {
|
||||
rDITHER_ENABLE = (dither_type == DITHER_SPATIO_TEMPORAL)? (1 << 0) : (1 << 1);
|
||||
} else {
|
||||
rDITHER_ENABLE = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2013 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 __DITHER_V2_H
|
||||
#define __DITHER_V2_H
|
||||
|
||||
#define rDITHER_ENABLE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0000)) //Enable Dither block
|
||||
#define rDITHER_METHOD (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0004)) //Main dithering method setting
|
||||
#define rDITHER_VERSION (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0008)) //Block revision number
|
||||
#define rDITHER_BOOST_POP (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x000c)) //Bit-popping and bit-boost
|
||||
#define rDITHER_OUTPUT_WIDTH (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0010)) //Output bit-width setting
|
||||
#define rDITHER_ST_OFFSET (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0014)) //Phase offset for Blue/Red wrt green
|
||||
#define rDITHER_ST_SEQUENCE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0018)) //Phase sequence for over 4 frames
|
||||
#define rDITHER_ST_KERNEL0 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x001c)) //Kernel0
|
||||
#define rDITHER_ST_KERNEL1 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0020)) //Kernel1
|
||||
#define rDITHER_ST_KERNEL2 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0024)) //Kernel2
|
||||
#define rDITHER_ST_KERNEL3 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0028)) //Kernel3
|
||||
#define rDITHER_ST_KERNEL4 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x002c)) //Kernel4
|
||||
#define rDITHER_ST_KERNEL5 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0030)) //Kernel5
|
||||
#define rDITHER_ST_KERNEL6 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0034)) //Kernel6
|
||||
#define rDITHER_ST_KERNEL7 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0038)) //Kernel7
|
||||
#define rDITHER_SKEWLOC0 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x003c)) //Skew location0
|
||||
#define rDITHER_SKEWLOC1 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0040)) //Skew location1
|
||||
#define rDITHER_SKEWLOC2 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0044)) //Skew location2
|
||||
#define rDITHER_SKEWLOC3 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0048)) //Skew location3
|
||||
#define rDITHER_SKEWLOC4 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x004c)) //Skew location4
|
||||
#define rDITHER_SKEWLOC5 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0050)) //Skew location5
|
||||
#define rDITHER_SKEWLOC6 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0054)) //Skew location6
|
||||
#define rDITHER_SKEWLOC7 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0058)) //Skew location7
|
||||
#define rDITHER_SKEWLOC8 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x005c)) //Skew location8
|
||||
#define rDITHER_SKEWLOC9 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0060)) //Skew location9
|
||||
#define rDITHER_SKEWLOC10 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0064)) //Skew location10
|
||||
#define rDITHER_SKEWLOC11 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0068)) //Skew location11
|
||||
#define rDITHER_SKEWLOC12 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x006c)) //Skew location12
|
||||
#define rDITHER_SKEWLOC13 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0070)) //Skew location13
|
||||
#define rDITHER_SKEWLOC14 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0074)) //Skew location14
|
||||
#define rDITHER_REG_UPDATE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0078)) //Register Update Control
|
||||
#define rDITHER_CRC_CON (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x007c)) //CRC Control Register
|
||||
#define rDITHER_CRC_R (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0080)) //CRC for R component
|
||||
#define rDITHER_CRC_G (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0084)) //CRC for G component
|
||||
#define rDITHER_CRC_B (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0088)) //CRC for B component
|
||||
#define rDITHER_HACTIVE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x008c)) //Dither Horizontal Active Width
|
||||
#define rDITHER_SPARE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0090)) //Spare Register
|
||||
|
||||
#endif /* ! __DITHER_V2_H */
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2013 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 _DITHER_V3_H
|
||||
#define _DITHER_V3_H
|
||||
|
||||
//Space-Temporal Dither Registers
|
||||
#define rDITHER_ST_VERSION (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0000)) //Version (major and minor revision number)
|
||||
#define rDITHER_ST_METHOD (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0004)) //Dither method setting
|
||||
#define rDITHER_ST_PHASE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0008)) //Sequence of dither matrix rotation phases
|
||||
#define rDITHER_ST_KERNEL0 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x000c)) //Kernel bit pattern for input pixel[2:0] == 0
|
||||
#define rDITHER_ST_KERNEL1 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0010)) //Kernel bit pattern for input pixel[2:0] == 1
|
||||
#define rDITHER_ST_KERNEL2 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0014)) //Kernel bit pattern for input pixel[2:0] == 2
|
||||
#define rDITHER_ST_KERNEL3 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0018)) //Kernel bit pattern for input pixel[2:0] == 3
|
||||
#define rDITHER_ST_KERNEL4 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x001c)) //Kernel bit pattern for input pixel[2:0] == 4
|
||||
#define rDITHER_ST_KERNEL5 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0020)) //Kernel bit pattern for input pixel[2:0] == 5
|
||||
#define rDITHER_ST_KERNEL6 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0024)) //Kernel bit pattern for input pixel[2:0] == 6
|
||||
#define rDITHER_ST_KERNEL7 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0028)) //Kernel bit pattern for input pixel[2:0] == 7
|
||||
#define rDITHER_ST_SKEWLOC0 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x002c)) //Skew location0
|
||||
#define rDITHER_ST_SKEWLOC1 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0030)) //Skew location1
|
||||
#define rDITHER_ST_SKEWLOC2 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0034)) //Skew location2
|
||||
#define rDITHER_ST_SKEWLOC3 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0038)) //Skew location3
|
||||
#define rDITHER_ST_SKEWLOC4 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x003c)) //Skew location4
|
||||
#define rDITHER_ST_SKEWLOC5 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0040)) //Skew location5
|
||||
#define rDITHER_ST_SKEWLOC6 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0044)) //Skew location6
|
||||
#define rDITHER_ST_SKEWLOC7 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0048)) //Skew location7
|
||||
#define rDITHER_ST_SKEWLOC8 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x004c)) //Skew location8
|
||||
#define rDITHER_ST_SKEWLOC9 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0050)) //Skew location9
|
||||
#define rDITHER_ST_SKEWLOC10 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0054)) //Skew location10
|
||||
#define rDITHER_ST_SKEWLOC11 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0058)) //Skew location11
|
||||
#define rDITHER_ST_SKEWLOC12 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x005c)) //Skew location12
|
||||
#define rDITHER_ST_SKEWLOC13 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0060)) //Skew location13
|
||||
#define rDITHER_ST_SKEWLOC14 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0064)) //Skew location14
|
||||
#define rDITHER_ST_CRC_CON (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0068)) //CRC Control Register
|
||||
#define rDITHER_ST_CRC_R (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x006c)) //CRC for R component
|
||||
#define rDITHER_ST_CRC_G (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0070)) //CRC for G component
|
||||
#define rDITHER_ST_CRC_B (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0074)) //CRC for B component
|
||||
|
||||
//Blue-noise
|
||||
#define rDITHER_BN_VERSION (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0080)) //Version (major and minor revision number)
|
||||
#define rDITHER_BN_OP_CFG (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0084)) //Configuration of Dither Operation
|
||||
#define rDITHER_BN_CONST (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0088)) //Constant Threshold for Blue Noise Dither
|
||||
#define DITHER_BN_CONST_THR2BIT 0x2
|
||||
#define DITHER_BN_CONST_THR4BIT 0x8
|
||||
#define DITHER_BN_CONST_THR5BIT 0x10
|
||||
|
||||
#endif /* ! _DITHER_V3_H */
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 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 _DITHER_V4_H
|
||||
#define _DITHER_V4_H
|
||||
|
||||
#define rDITHER_ENABLE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0000)) //Enable register for pipeline blocks
|
||||
#define rDITHER_UPDATECONTROL (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0004)) //Synchronize LUT and register updates to next vertical blank interval
|
||||
#define DITHER_UPDATECONTROL_UPDATEENABLETIMING (1 << 1)
|
||||
#define DITHER_UPDATECONTROL_UPDATEREQTIMING (1 << 0)
|
||||
|
||||
#define rDITHER_ACTIVEREGIONSTART (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0008)) //Pixel Coordinates of Upper Left Hand of Active Window
|
||||
#define rDITHER_ACTIVEREGIONSIZE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x000C)) //Width and Height of Active Region
|
||||
#define rDITHER_INBITSREDUCTION (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0010)) //Reduce input pixel width
|
||||
#define rDITHER_EDOUTTOSTINWIDTH (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0014)) //Pixel width between ED and ST
|
||||
#define rDITHER_DITHEROUTWIDTH (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0018)) //Output width of dither pipeline. Unused bits will be 0.
|
||||
|
||||
//ED Dither
|
||||
#define rDITHER_ED_THRESHOLDRED (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0080)) //Per Channel Threshold Registers. This is typically set to equivalent pixel value of .5
|
||||
#define rDITHER_ED_THRESHOLDGREEN (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0084)) //Per Channel Threshold Registers. This is typically set to equivalent pixel value of .5
|
||||
#define rDITHER_ED_THRESHOLDBLUE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0088)) //Per Channel Threshold Registers. This is typically set to equivalent pixel value of .5
|
||||
|
||||
// XXX - Are these right???
|
||||
#define DITHER_BN_CONST_THR2BIT 0x2
|
||||
#define DITHER_BN_CONST_THR4BIT 0x8
|
||||
#define DITHER_BN_CONST_THR5BIT 0x10
|
||||
|
||||
//Space-Temporal Dither Registers
|
||||
#define rDITHER_ST_METHOD (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0100)) //Dither method setting
|
||||
#define rDITHER_ST_PHASE (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0104)) //Sequence of dither matrix rotation phases
|
||||
#define rDITHER_ST_KERNEL0 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0108)) //Kernel bit pattern for input pixel[2:0] == 0
|
||||
#define rDITHER_ST_KERNEL1 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x010C)) //Kernel bit pattern for input pixel[2:0] == 1
|
||||
#define rDITHER_ST_KERNEL2 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0110)) //Kernel bit pattern for input pixel[2:0] == 2
|
||||
#define rDITHER_ST_KERNEL3 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0114)) //Kernel bit pattern for input pixel[2:0] == 3
|
||||
#define rDITHER_ST_KERNEL4 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0118)) //Kernel bit pattern for input pixel[2:0] == 4
|
||||
#define rDITHER_ST_KERNEL5 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x011C)) //Kernel bit pattern for input pixel[2:0] == 5
|
||||
#define rDITHER_ST_KERNEL6 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0120)) //Kernel bit pattern for input pixel[2:0] == 6
|
||||
#define rDITHER_ST_KERNEL7 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0124)) //Kernel bit pattern for input pixel[2:0] == 7
|
||||
#define rDITHER_ST_SKEWLOC0 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0128)) //Skew location0
|
||||
#define rDITHER_ST_SKEWLOC1 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x012C)) //Skew location1
|
||||
#define rDITHER_ST_SKEWLOC2 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0130)) //Skew location2
|
||||
#define rDITHER_ST_SKEWLOC3 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0134)) //Skew location3
|
||||
#define rDITHER_ST_SKEWLOC4 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0138)) //Skew location4
|
||||
#define rDITHER_ST_SKEWLOC5 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x013C)) //Skew location5
|
||||
#define rDITHER_ST_SKEWLOC6 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0140)) //Skew location6
|
||||
#define rDITHER_ST_SKEWLOC7 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0144)) //Skew location7
|
||||
#define rDITHER_ST_SKEWLOC8 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0148)) //Skew location8
|
||||
#define rDITHER_ST_SKEWLOC9 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x014C)) //Skew location9
|
||||
#define rDITHER_ST_SKEWLOC10 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0150)) //Skew location10
|
||||
#define rDITHER_ST_SKEWLOC11 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0154)) //Skew location11
|
||||
#define rDITHER_ST_SKEWLOC12 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0158)) //Skew location12
|
||||
#define rDITHER_ST_SKEWLOC13 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x015C)) //Skew location13
|
||||
#define rDITHER_ST_SKEWLOC14 (*(volatile u_int32_t *)(DITHER_BASE_ADDR + 0x0160)) //Skew location14
|
||||
|
||||
#endif /* ! _DITHER_V4_H */
|
||||
@@ -0,0 +1,16 @@
|
||||
# Copyright (C) 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_HW_DITHER=1
|
||||
|
||||
ALL_OBJS += \
|
||||
$(LOCAL_DIR)/dither.o
|
||||
Reference in new issue
Block a user