mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge branch 'sh/alphaproject' into sh-latest
This commit is contained in:
@@ -457,6 +457,9 @@ ChangeLog
|
||||
|
||||
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
|
||||
|
||||
2.1.30:
|
||||
- Fix writev() (it kept writing the first segment over and over again
|
||||
instead of moving onto subsequent segments).
|
||||
2.1.29:
|
||||
- Fix a deadlock when mounting read-write.
|
||||
2.1.28:
|
||||
|
||||
@@ -4383,11 +4383,11 @@ F: Documentation/scsi/NinjaSCSI.txt
|
||||
F: drivers/scsi/nsp32*
|
||||
|
||||
NTFS FILESYSTEM
|
||||
M: Anton Altaparmakov <aia21@cantab.net>
|
||||
M: Anton Altaparmakov <anton@tuxera.com>
|
||||
L: linux-ntfs-dev@lists.sourceforge.net
|
||||
W: http://www.linux-ntfs.org/
|
||||
W: http://www.tuxera.com/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
|
||||
S: Maintained
|
||||
S: Supported
|
||||
F: Documentation/filesystems/ntfs.txt
|
||||
F: fs/ntfs/
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ menu "Board support"
|
||||
config SOLUTION_ENGINE
|
||||
bool
|
||||
|
||||
config SH_ALPHA_BOARD
|
||||
bool
|
||||
|
||||
config SH_SOLUTION_ENGINE
|
||||
bool "SolutionEngine"
|
||||
select SOLUTION_ENGINE
|
||||
@@ -320,6 +323,21 @@ config SH_SH2007
|
||||
Compact Flash socket, two serial ports and PC-104 bus.
|
||||
More information at <http://sh2000.sh-linux.org>.
|
||||
|
||||
config SH_APSH4A3A
|
||||
bool "AP-SH4A-3A"
|
||||
select SH_ALPHA_BOARD
|
||||
depends on CPU_SUBTYPE_SH7785
|
||||
help
|
||||
Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A.
|
||||
|
||||
config SH_APSH4AD0A
|
||||
bool "AP-SH4AD-0A"
|
||||
select SH_ALPHA_BOARD
|
||||
select SYS_SUPPORTS_PCI
|
||||
depends on CPU_SUBTYPE_SH7786
|
||||
help
|
||||
Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A.
|
||||
|
||||
endmenu
|
||||
|
||||
source "arch/sh/boards/mach-r2d/Kconfig"
|
||||
|
||||
@@ -13,3 +13,5 @@ obj-$(CONFIG_SH_ESPT) += board-espt.o
|
||||
obj-$(CONFIG_SH_POLARIS) += board-polaris.o
|
||||
obj-$(CONFIG_SH_TITAN) += board-titan.o
|
||||
obj-$(CONFIG_SH_SH7757LCR) += board-sh7757lcr.o
|
||||
obj-$(CONFIG_SH_APSH4A3A) += board-apsh4a3a.o
|
||||
obj-$(CONFIG_SH_APSH4AD0A) += board-apsh4ad0a.o
|
||||
|
||||
175
arch/sh/boards/board-apsh4a3a.c
Normal file
175
arch/sh/boards/board-apsh4a3a.c
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* ALPHAPROJECT AP-SH4A-3A Support.
|
||||
*
|
||||
* Copyright (C) 2010 ALPHAPROJECT Co.,Ltd.
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda
|
||||
* Copyright (C) 2009 Paul Mundt
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/smsc911x.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/clk.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/sizes.h>
|
||||
#include <asm/clock.h>
|
||||
|
||||
static struct mtd_partition nor_flash_partitions[] = {
|
||||
{
|
||||
.name = "loader",
|
||||
.offset = 0x00000000,
|
||||
.size = 512 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "bootenv",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 512 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "kernel",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 4 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "data",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct physmap_flash_data nor_flash_data = {
|
||||
.width = 4,
|
||||
.parts = nor_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(nor_flash_partitions),
|
||||
};
|
||||
|
||||
static struct resource nor_flash_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x00000000,
|
||||
.end = 0x01000000 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device nor_flash_device = {
|
||||
.name = "physmap-flash",
|
||||
.dev = {
|
||||
.platform_data = &nor_flash_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(nor_flash_resources),
|
||||
.resource = nor_flash_resources,
|
||||
};
|
||||
|
||||
static struct resource smsc911x_resources[] = {
|
||||
[0] = {
|
||||
.name = "smsc911x-memory",
|
||||
.start = 0xA4000000,
|
||||
.end = 0xA4000000 + SZ_256 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.name = "smsc911x-irq",
|
||||
.start = evt2irq(0x200),
|
||||
.end = evt2irq(0x200),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct smsc911x_platform_config smsc911x_config = {
|
||||
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
|
||||
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
|
||||
.flags = SMSC911X_USE_16BIT,
|
||||
.phy_interface = PHY_INTERFACE_MODE_MII,
|
||||
};
|
||||
|
||||
static struct platform_device smsc911x_device = {
|
||||
.name = "smsc911x",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(smsc911x_resources),
|
||||
.resource = smsc911x_resources,
|
||||
.dev = {
|
||||
.platform_data = &smsc911x_config,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *apsh4a3a_devices[] __initdata = {
|
||||
&nor_flash_device,
|
||||
&smsc911x_device,
|
||||
};
|
||||
|
||||
static int __init apsh4a3a_devices_setup(void)
|
||||
{
|
||||
return platform_add_devices(apsh4a3a_devices,
|
||||
ARRAY_SIZE(apsh4a3a_devices));
|
||||
}
|
||||
device_initcall(apsh4a3a_devices_setup);
|
||||
|
||||
static int apsh4a3a_clk_init(void)
|
||||
{
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
|
||||
clk = clk_get(NULL, "extal");
|
||||
if (!clk || IS_ERR(clk))
|
||||
return PTR_ERR(clk);
|
||||
ret = clk_set_rate(clk, 33333000);
|
||||
clk_put(clk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Initialize the board */
|
||||
static void __init apsh4a3a_setup(char **cmdline_p)
|
||||
{
|
||||
printk(KERN_INFO "Alpha Project AP-SH4A-3A support:\n");
|
||||
}
|
||||
|
||||
static void __init apsh4a3a_init_irq(void)
|
||||
{
|
||||
plat_irq_setup_pins(IRQ_MODE_IRQ7654);
|
||||
}
|
||||
|
||||
/* Return the board specific boot mode pin configuration */
|
||||
static int apsh4a3a_mode_pins(void)
|
||||
{
|
||||
int value = 0;
|
||||
|
||||
/* These are the factory default settings of SW1 and SW2.
|
||||
* If you change these dip switches then you will need to
|
||||
* adjust the values below as well.
|
||||
*/
|
||||
value &= ~MODE_PIN0; /* Clock Mode 16 */
|
||||
value &= ~MODE_PIN1;
|
||||
value &= ~MODE_PIN2;
|
||||
value &= ~MODE_PIN3;
|
||||
value |= MODE_PIN4;
|
||||
value &= ~MODE_PIN5; /* 16-bit Area0 bus width */
|
||||
value |= MODE_PIN6; /* Area 0 SRAM interface */
|
||||
value |= MODE_PIN7;
|
||||
value |= MODE_PIN8; /* Little Endian */
|
||||
value |= MODE_PIN9; /* Master Mode */
|
||||
value |= MODE_PIN10; /* Crystal resonator */
|
||||
value |= MODE_PIN11; /* Display Unit */
|
||||
value |= MODE_PIN12;
|
||||
value &= ~MODE_PIN13; /* 29-bit address mode */
|
||||
value |= MODE_PIN14; /* No PLL step-up */
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* The Machine Vector
|
||||
*/
|
||||
static struct sh_machine_vector mv_apsh4a3a __initmv = {
|
||||
.mv_name = "AP-SH4A-3A",
|
||||
.mv_setup = apsh4a3a_setup,
|
||||
.mv_clk_init = apsh4a3a_clk_init,
|
||||
.mv_init_irq = apsh4a3a_init_irq,
|
||||
.mv_mode_pins = apsh4a3a_mode_pins,
|
||||
};
|
||||
125
arch/sh/boards/board-apsh4ad0a.c
Normal file
125
arch/sh/boards/board-apsh4ad0a.c
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* ALPHAPROJECT AP-SH4AD-0A Support.
|
||||
*
|
||||
* Copyright (C) 2010 ALPHAPROJECT Co.,Ltd.
|
||||
* Copyright (C) 2010 Matt Fleming
|
||||
* Copyright (C) 2010 Paul Mundt
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/smsc911x.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/clk.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/sizes.h>
|
||||
|
||||
static struct resource smsc911x_resources[] = {
|
||||
[0] = {
|
||||
.name = "smsc911x-memory",
|
||||
.start = 0xA4000000,
|
||||
.end = 0xA4000000 + SZ_256 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.name = "smsc911x-irq",
|
||||
.start = evt2irq(0x200),
|
||||
.end = evt2irq(0x200),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct smsc911x_platform_config smsc911x_config = {
|
||||
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
|
||||
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
|
||||
.flags = SMSC911X_USE_16BIT,
|
||||
.phy_interface = PHY_INTERFACE_MODE_MII,
|
||||
};
|
||||
|
||||
static struct platform_device smsc911x_device = {
|
||||
.name = "smsc911x",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(smsc911x_resources),
|
||||
.resource = smsc911x_resources,
|
||||
.dev = {
|
||||
.platform_data = &smsc911x_config,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *apsh4ad0a_devices[] __initdata = {
|
||||
&smsc911x_device,
|
||||
};
|
||||
|
||||
static int __init apsh4ad0a_devices_setup(void)
|
||||
{
|
||||
return platform_add_devices(apsh4ad0a_devices,
|
||||
ARRAY_SIZE(apsh4ad0a_devices));
|
||||
}
|
||||
device_initcall(apsh4ad0a_devices_setup);
|
||||
|
||||
static int apsh4ad0a_mode_pins(void)
|
||||
{
|
||||
int value = 0;
|
||||
|
||||
/* These are the factory default settings of SW1 and SW2.
|
||||
* If you change these dip switches then you will need to
|
||||
* adjust the values below as well.
|
||||
*/
|
||||
value |= MODE_PIN0; /* Clock Mode 3 */
|
||||
value |= MODE_PIN1;
|
||||
value &= ~MODE_PIN2;
|
||||
value &= ~MODE_PIN3;
|
||||
value &= ~MODE_PIN4; /* 16-bit Area0 bus width */
|
||||
value |= MODE_PIN5;
|
||||
value |= MODE_PIN6;
|
||||
value |= MODE_PIN7; /* Normal mode */
|
||||
value |= MODE_PIN8; /* Little Endian */
|
||||
value |= MODE_PIN9; /* Crystal resonator */
|
||||
value &= ~MODE_PIN10; /* 29-bit address mode */
|
||||
value &= ~MODE_PIN11; /* PCI-E Root port */
|
||||
value &= ~MODE_PIN12; /* 4 lane + 1 lane */
|
||||
value |= MODE_PIN13; /* AUD Enable */
|
||||
value &= ~MODE_PIN14; /* Normal Operation */
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static int apsh4ad0a_clk_init(void)
|
||||
{
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
|
||||
clk = clk_get(NULL, "extal");
|
||||
if (!clk || IS_ERR(clk))
|
||||
return PTR_ERR(clk);
|
||||
ret = clk_set_rate(clk, 33333000);
|
||||
clk_put(clk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Initialize the board */
|
||||
static void __init apsh4ad0a_setup(char **cmdline_p)
|
||||
{
|
||||
pr_info("Alpha Project AP-SH4AD-0A support:\n");
|
||||
}
|
||||
|
||||
static void __init apsh4ad0a_init_irq(void)
|
||||
{
|
||||
plat_irq_setup_pins(IRQ_MODE_IRQ3210);
|
||||
}
|
||||
|
||||
/*
|
||||
* The Machine Vector
|
||||
*/
|
||||
static struct sh_machine_vector mv_apsh4ad0a __initmv = {
|
||||
.mv_name = "AP-SH4AD-0A",
|
||||
.mv_setup = apsh4ad0a_setup,
|
||||
.mv_mode_pins = apsh4ad0a_mode_pins,
|
||||
.mv_clk_init = apsh4ad0a_clk_init,
|
||||
.mv_init_irq = apsh4ad0a_init_irq,
|
||||
};
|
||||
102
arch/sh/configs/apsh4a3a_defconfig
Normal file
102
arch/sh/configs/apsh4a3a_defconfig
Normal file
@@ -0,0 +1,102 @@
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
CONFIG_SYSFS_DEPRECATED=y
|
||||
CONFIG_SYSFS_DEPRECATED_V2=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_SLAB=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
CONFIG_CPU_SUBTYPE_SH7785=y
|
||||
CONFIG_MEMORY_START=0x0C000000
|
||||
CONFIG_FLATMEM_MANUAL=y
|
||||
CONFIG_SH_STORE_QUEUES=y
|
||||
CONFIG_SH_APSH4A3A=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_PREEMPT=y
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_ADVANCED_ROUTER=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
||||
# CONFIG_FW_LOADER is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CONCAT=y
|
||||
CONFIG_MTD_PARTITIONS=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_CFI_AMDSTD=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_SIZE=16384
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_NET_ETHERNET=y
|
||||
CONFIG_SMSC911X=y
|
||||
# CONFIG_NETDEV_1000 is not set
|
||||
# CONFIG_NETDEV_10000 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_INPUT_MOUSEDEV is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_VT_HW_CONSOLE_BINDING=y
|
||||
CONFIG_SERIAL_SH_SCI=y
|
||||
CONFIG_SERIAL_SH_SCI_NR_UARTS=6
|
||||
CONFIG_SERIAL_SH_SCI_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_SH7785FB=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FONTS=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_LOGO=y
|
||||
# CONFIG_HID_SUPPORT is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT3_FS=y
|
||||
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=y
|
||||
CONFIG_NTFS_RW=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_CRAMFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3=y
|
||||
CONFIG_NFS_V4=y
|
||||
CONFIG_CIFS=y
|
||||
CONFIG_NLS_DEFAULT="utf8"
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_932=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_DEBUG_PREEMPT is not set
|
||||
# CONFIG_DEBUG_BUGVERBOSE is not set
|
||||
CONFIG_DEBUG_INFO=y
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
# CONFIG_FTRACE is not set
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
133
arch/sh/configs/apsh4ad0a_defconfig
Normal file
133
arch/sh/configs/apsh4ad0a_defconfig
Normal file
@@ -0,0 +1,133 @@
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_RCU_TRACE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_CGROUP_NS=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_CGROUP_MEM_RES_CTLR=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_SLAB=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
# CONFIG_LBDAF is not set
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
CONFIG_CFQ_GROUP_IOSCHED=y
|
||||
CONFIG_CPU_SUBTYPE_SH7786=y
|
||||
CONFIG_MEMORY_SIZE=0x10000000
|
||||
CONFIG_HUGETLB_PAGE_SIZE_1MB=y
|
||||
CONFIG_MEMORY_HOTPLUG=y
|
||||
CONFIG_MEMORY_HOTREMOVE=y
|
||||
CONFIG_KSM=y
|
||||
CONFIG_SH_STORE_QUEUES=y
|
||||
CONFIG_SH_APSH4AD0A=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=m
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
|
||||
CONFIG_SH_CPU_FREQ=y
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_PREEMPT=y
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_BINFMT_MISC=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_DEBUG=y
|
||||
CONFIG_PM_VERBOSE=y
|
||||
CONFIG_PM_RUNTIME=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_NET_KEY=y
|
||||
CONFIG_INET=y
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
||||
# CONFIG_FW_LOADER is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_SIZE=16384
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_SCSI_MULTI_LUN=y
|
||||
# CONFIG_SCSI_LOWLEVEL is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_MDIO_BITBANG=y
|
||||
CONFIG_NET_ETHERNET=y
|
||||
CONFIG_SMSC911X=y
|
||||
# CONFIG_NETDEV_1000 is not set
|
||||
# CONFIG_NETDEV_10000 is not set
|
||||
# CONFIG_WLAN is not set
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_SH_SCI=y
|
||||
CONFIG_SERIAL_SH_SCI_NR_UARTS=6
|
||||
CONFIG_SERIAL_SH_SCI_CONSOLE=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_VIDEO_OUTPUT_CONTROL=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_SH7785FB=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FONTS=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_DEBUG=y
|
||||
CONFIG_USB_MON=y
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT3_FS=y
|
||||
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=y
|
||||
CONFIG_NTFS_RW=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_CRAMFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3=y
|
||||
CONFIG_NFS_V4=y
|
||||
CONFIG_CIFS=y
|
||||
CONFIG_NLS_DEFAULT="utf8"
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_932=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_SHIRQ=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_VM=y
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
CONFIG_DWARF_UNWINDER=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
@@ -9,6 +9,7 @@ SE SH_SOLUTION_ENGINE
|
||||
HIGHLANDER SH_HIGHLANDER
|
||||
RTS7751R2D SH_RTS7751R2D
|
||||
RSK SH_RSK
|
||||
ALPHA_BOARD SH_ALPHA_BOARD
|
||||
|
||||
#
|
||||
# List of companion chips / MFDs.
|
||||
@@ -61,3 +62,5 @@ ESPT SH_ESPT
|
||||
POLARIS SH_POLARIS
|
||||
KFR2R09 SH_KFR2R09
|
||||
ECOVEC SH_ECOVEC
|
||||
APSH4A3A SH_APSH4A3A
|
||||
APSH4AD0A SH_APSH4AD0A
|
||||
|
||||
@@ -464,6 +464,7 @@ config XEN_BLKDEV_FRONTEND
|
||||
tristate "Xen virtual block device support"
|
||||
depends on XEN
|
||||
default y
|
||||
select XEN_XENBUS_FRONTEND
|
||||
help
|
||||
This driver implements the front-end of the Xen virtual
|
||||
block device driver. It communicates with a back-end driver
|
||||
|
||||
@@ -94,6 +94,8 @@
|
||||
#define G4x_GMCH_SIZE_VT_1_5M (0xa << 8)
|
||||
#define G4x_GMCH_SIZE_VT_2M (0xc << 8)
|
||||
|
||||
#define GFX_FLSH_CNTL 0x2170 /* 915+ */
|
||||
|
||||
#define I810_DRAM_CTL 0x3000
|
||||
#define I810_DRAM_ROW_0 0x00000001
|
||||
#define I810_DRAM_ROW_0_SDRAM 0x00000001
|
||||
|
||||
@@ -688,14 +688,14 @@ static int intel_gtt_init(void)
|
||||
|
||||
intel_private.base.stolen_size = intel_gtt_stolen_size();
|
||||
|
||||
intel_private.base.needs_dmar = USE_PCI_DMA_API && INTEL_GTT_GEN > 2;
|
||||
|
||||
ret = intel_gtt_setup_scratch_page();
|
||||
if (ret != 0) {
|
||||
intel_gtt_cleanup();
|
||||
return ret;
|
||||
}
|
||||
|
||||
intel_private.base.needs_dmar = USE_PCI_DMA_API && INTEL_GTT_GEN > 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -814,6 +814,12 @@ static bool intel_enable_gtt(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* On the resume path we may be adjusting the PGTBL value, so
|
||||
* be paranoid and flush all chipset write buffers...
|
||||
*/
|
||||
if (INTEL_GTT_GEN >= 3)
|
||||
writel(0, intel_private.registers+GFX_FLSH_CNTL);
|
||||
|
||||
reg = intel_private.registers+I810_PGETBL_CTL;
|
||||
writel(intel_private.PGETBL_save, reg);
|
||||
if (HAS_PGTBL_EN && (readl(reg) & I810_PGETBL_ENABLED) == 0) {
|
||||
@@ -823,6 +829,9 @@ static bool intel_enable_gtt(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (INTEL_GTT_GEN >= 3)
|
||||
writel(0, intel_private.registers+GFX_FLSH_CNTL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -991,14 +1000,14 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem,
|
||||
if (mem->page_count == 0)
|
||||
return 0;
|
||||
|
||||
intel_gtt_clear_range(pg_start, mem->page_count);
|
||||
|
||||
if (intel_private.base.needs_dmar) {
|
||||
intel_gtt_unmap_memory(mem->sg_list, mem->num_sg);
|
||||
mem->sg_list = NULL;
|
||||
mem->num_sg = 0;
|
||||
}
|
||||
|
||||
intel_gtt_clear_range(pg_start, mem->page_count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,10 +106,19 @@ static const char *get_tiling_flag(struct drm_i915_gem_object *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static const char *agp_type_str(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case 0: return " uncached";
|
||||
case 1: return " snooped";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
|
||||
{
|
||||
seq_printf(m, "%p: %s%s %8zd %04x %04x %d %d%s%s",
|
||||
seq_printf(m, "%p: %s%s %8zd %04x %04x %d %d%s%s%s",
|
||||
&obj->base,
|
||||
get_pin_flag(obj),
|
||||
get_tiling_flag(obj),
|
||||
@@ -118,6 +127,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
|
||||
obj->base.write_domain,
|
||||
obj->last_rendering_seqno,
|
||||
obj->last_fenced_seqno,
|
||||
agp_type_str(obj->agp_type == AGP_USER_CACHED_MEMORY),
|
||||
obj->dirty ? " dirty" : "",
|
||||
obj->madv == I915_MADV_DONTNEED ? " purgeable" : "");
|
||||
if (obj->base.name)
|
||||
@@ -276,6 +286,37 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_gem_gtt_info(struct seq_file *m, void* data)
|
||||
{
|
||||
struct drm_info_node *node = (struct drm_info_node *) m->private;
|
||||
struct drm_device *dev = node->minor->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_i915_gem_object *obj;
|
||||
size_t total_obj_size, total_gtt_size;
|
||||
int count, ret;
|
||||
|
||||
ret = mutex_lock_interruptible(&dev->struct_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
total_obj_size = total_gtt_size = count = 0;
|
||||
list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) {
|
||||
seq_printf(m, " ");
|
||||
describe_obj(m, obj);
|
||||
seq_printf(m, "\n");
|
||||
total_obj_size += obj->base.size;
|
||||
total_gtt_size += obj->gtt_space->size;
|
||||
count++;
|
||||
}
|
||||
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
seq_printf(m, "Total %d objects, %zu bytes, %zu GTT size\n",
|
||||
count, total_obj_size, total_gtt_size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int i915_gem_pageflip_info(struct seq_file *m, void *data)
|
||||
{
|
||||
@@ -456,8 +497,14 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
|
||||
}
|
||||
seq_printf(m, "Interrupts received: %d\n",
|
||||
atomic_read(&dev_priv->irq_received));
|
||||
for (i = 0; i < I915_NUM_RINGS; i++)
|
||||
for (i = 0; i < I915_NUM_RINGS; i++) {
|
||||
if (IS_GEN6(dev)) {
|
||||
seq_printf(m, "Graphics Interrupt mask (%s): %08x\n",
|
||||
dev_priv->ring[i].name,
|
||||
I915_READ_IMR(&dev_priv->ring[i]));
|
||||
}
|
||||
i915_ring_seqno_info(m, &dev_priv->ring[i]);
|
||||
}
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
return 0;
|
||||
@@ -656,7 +703,7 @@ static void print_error_buffers(struct seq_file *m,
|
||||
seq_printf(m, "%s [%d]:\n", name, count);
|
||||
|
||||
while (count--) {
|
||||
seq_printf(m, " %08x %8zd %04x %04x %08x%s%s%s%s%s",
|
||||
seq_printf(m, " %08x %8zd %04x %04x %08x%s%s%s%s%s%s",
|
||||
err->gtt_offset,
|
||||
err->size,
|
||||
err->read_domains,
|
||||
@@ -666,7 +713,8 @@ static void print_error_buffers(struct seq_file *m,
|
||||
tiling_flag(err->tiling),
|
||||
dirty_flag(err->dirty),
|
||||
purgeable_flag(err->purgeable),
|
||||
ring_str(err->ring));
|
||||
ring_str(err->ring),
|
||||
agp_type_str(err->agp_type));
|
||||
|
||||
if (err->name)
|
||||
seq_printf(m, " (name: %d)", err->name);
|
||||
@@ -744,7 +792,9 @@ static int i915_error_state(struct seq_file *m, void *unused)
|
||||
if (error->batchbuffer[i]) {
|
||||
struct drm_i915_error_object *obj = error->batchbuffer[i];
|
||||
|
||||
seq_printf(m, "--- gtt_offset = 0x%08x\n", obj->gtt_offset);
|
||||
seq_printf(m, "%s --- gtt_offset = 0x%08x\n",
|
||||
dev_priv->ring[i].name,
|
||||
obj->gtt_offset);
|
||||
offset = 0;
|
||||
for (page = 0; page < obj->page_count; page++) {
|
||||
for (elt = 0; elt < PAGE_SIZE/4; elt++) {
|
||||
@@ -890,7 +940,7 @@ static int i915_drpc_info(struct seq_file *m, void *unused)
|
||||
struct drm_device *dev = node->minor->dev;
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
u32 rgvmodectl = I915_READ(MEMMODECTL);
|
||||
u32 rstdbyctl = I915_READ(MCHBAR_RENDER_STANDBY);
|
||||
u32 rstdbyctl = I915_READ(RSTDBYCTL);
|
||||
u16 crstandvid = I915_READ16(CRSTANDVID);
|
||||
|
||||
seq_printf(m, "HD boost: %s\n", (rgvmodectl & MEMMODE_BOOST_EN) ?
|
||||
@@ -913,6 +963,30 @@ static int i915_drpc_info(struct seq_file *m, void *unused)
|
||||
seq_printf(m, "RS2 VID: %d\n", ((crstandvid >> 8) & 0x3f));
|
||||
seq_printf(m, "Render standby enabled: %s\n",
|
||||
(rstdbyctl & RCX_SW_EXIT) ? "no" : "yes");
|
||||
seq_printf(m, "Current RS state: ");
|
||||
switch (rstdbyctl & RSX_STATUS_MASK) {
|
||||
case RSX_STATUS_ON:
|
||||
seq_printf(m, "on\n");
|
||||
break;
|
||||
case RSX_STATUS_RC1:
|
||||
seq_printf(m, "RC1\n");
|
||||
break;
|
||||
case RSX_STATUS_RC1E:
|
||||
seq_printf(m, "RC1E\n");
|
||||
break;
|
||||
case RSX_STATUS_RS1:
|
||||
seq_printf(m, "RS1\n");
|
||||
break;
|
||||
case RSX_STATUS_RS2:
|
||||
seq_printf(m, "RS2 (RC6)\n");
|
||||
break;
|
||||
case RSX_STATUS_RS3:
|
||||
seq_printf(m, "RC3 (RC6+)\n");
|
||||
break;
|
||||
default:
|
||||
seq_printf(m, "unknown\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1187,6 +1261,7 @@ static int i915_wedged_create(struct dentry *root, struct drm_minor *minor)
|
||||
static struct drm_info_list i915_debugfs_list[] = {
|
||||
{"i915_capabilities", i915_capabilities, 0, 0},
|
||||
{"i915_gem_objects", i915_gem_object_info, 0},
|
||||
{"i915_gem_gtt", i915_gem_gtt_info, 0},
|
||||
{"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST},
|
||||
{"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST},
|
||||
{"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST},
|
||||
|
||||
@@ -1962,13 +1962,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
/* enable GEM by default */
|
||||
dev_priv->has_gem = 1;
|
||||
|
||||
if (dev_priv->has_gem == 0 &&
|
||||
drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
DRM_ERROR("kernel modesetting requires GEM, disabling driver.\n");
|
||||
ret = -ENODEV;
|
||||
goto out_workqueue_free;
|
||||
}
|
||||
|
||||
dev->driver->get_vblank_counter = i915_get_vblank_counter;
|
||||
dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
|
||||
if (IS_G4X(dev) || IS_GEN5(dev) || IS_GEN6(dev)) {
|
||||
@@ -2055,7 +2048,6 @@ out_gem_unload:
|
||||
|
||||
intel_teardown_gmbus(dev);
|
||||
intel_teardown_mchbar(dev);
|
||||
out_workqueue_free:
|
||||
destroy_workqueue(dev_priv->wq);
|
||||
out_iomapfree:
|
||||
io_mapping_free(dev_priv->mm.gtt_mapping);
|
||||
|
||||
@@ -49,6 +49,9 @@ module_param_named(powersave, i915_powersave, int, 0600);
|
||||
unsigned int i915_lvds_downclock = 0;
|
||||
module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);
|
||||
|
||||
bool i915_try_reset = true;
|
||||
module_param_named(reset, i915_try_reset, bool, 0600);
|
||||
|
||||
static struct drm_driver driver;
|
||||
extern int intel_agp_enabled;
|
||||
|
||||
@@ -352,6 +355,9 @@ static int i915_drm_thaw(struct drm_device *dev)
|
||||
|
||||
/* Resume the modeset for every activated CRTC */
|
||||
drm_helper_resume_force_mode(dev);
|
||||
|
||||
if (dev_priv->renderctx && dev_priv->pwrctx)
|
||||
ironlake_enable_rc6(dev);
|
||||
}
|
||||
|
||||
intel_opregion_init(dev);
|
||||
@@ -475,6 +481,9 @@ int i915_reset(struct drm_device *dev, u8 flags)
|
||||
bool need_display = true;
|
||||
int ret;
|
||||
|
||||
if (!i915_try_reset)
|
||||
return 0;
|
||||
|
||||
if (!mutex_trylock(&dev->struct_mutex))
|
||||
return -EBUSY;
|
||||
|
||||
|
||||
@@ -172,20 +172,21 @@ struct drm_i915_error_state {
|
||||
int page_count;
|
||||
u32 gtt_offset;
|
||||
u32 *pages[0];
|
||||
} *ringbuffer, *batchbuffer[2];
|
||||
} *ringbuffer, *batchbuffer[I915_NUM_RINGS];
|
||||
struct drm_i915_error_buffer {
|
||||
size_t size;
|
||||
u32 size;
|
||||
u32 name;
|
||||
u32 seqno;
|
||||
u32 gtt_offset;
|
||||
u32 read_domains;
|
||||
u32 write_domain;
|
||||
u32 fence_reg;
|
||||
s32 fence_reg:5;
|
||||
s32 pinned:2;
|
||||
u32 tiling:2;
|
||||
u32 dirty:1;
|
||||
u32 purgeable:1;
|
||||
u32 ring:4;
|
||||
u32 agp_type:1;
|
||||
} *active_bo, *pinned_bo;
|
||||
u32 active_bo_count, pinned_bo_count;
|
||||
struct intel_overlay_error_state *overlay;
|
||||
@@ -332,6 +333,7 @@ typedef struct drm_i915_private {
|
||||
|
||||
/* LVDS info */
|
||||
int backlight_level; /* restore backlight to this value */
|
||||
bool backlight_enabled;
|
||||
struct drm_display_mode *panel_fixed_mode;
|
||||
struct drm_display_mode *lfp_lvds_vbt_mode; /* if any */
|
||||
struct drm_display_mode *sdvo_lvds_vbt_mode; /* if any */
|
||||
@@ -794,6 +796,7 @@ struct drm_i915_gem_object {
|
||||
*/
|
||||
struct hlist_node exec_node;
|
||||
unsigned long exec_handle;
|
||||
struct drm_i915_gem_exec_object2 *exec_entry;
|
||||
|
||||
/**
|
||||
* Current offset of the object in GTT space.
|
||||
@@ -1006,12 +1009,6 @@ extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc);
|
||||
extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc);
|
||||
extern int i915_vblank_swap(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask);
|
||||
extern void i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask);
|
||||
extern void ironlake_enable_graphics_irq(drm_i915_private_t *dev_priv,
|
||||
u32 mask);
|
||||
extern void ironlake_disable_graphics_irq(drm_i915_private_t *dev_priv,
|
||||
u32 mask);
|
||||
|
||||
void
|
||||
i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
|
||||
@@ -1091,10 +1088,10 @@ int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
void i915_gem_load(struct drm_device *dev);
|
||||
int i915_gem_init_object(struct drm_gem_object *obj);
|
||||
void i915_gem_flush_ring(struct drm_device *dev,
|
||||
struct intel_ring_buffer *ring,
|
||||
uint32_t invalidate_domains,
|
||||
uint32_t flush_domains);
|
||||
int __must_check i915_gem_flush_ring(struct drm_device *dev,
|
||||
struct intel_ring_buffer *ring,
|
||||
uint32_t invalidate_domains,
|
||||
uint32_t flush_domains);
|
||||
struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
|
||||
size_t size);
|
||||
void i915_gem_free_object(struct drm_gem_object *obj);
|
||||
@@ -1265,6 +1262,7 @@ extern void intel_disable_fbc(struct drm_device *dev);
|
||||
extern void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval);
|
||||
extern bool intel_fbc_enabled(struct drm_device *dev);
|
||||
extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
|
||||
extern void ironlake_enable_rc6(struct drm_device *dev);
|
||||
extern void gen6_set_rps(struct drm_device *dev, u8 val);
|
||||
extern void intel_detect_pch (struct drm_device *dev);
|
||||
extern int intel_trans_dp_port_sel (struct drm_crtc *crtc);
|
||||
|
||||
@@ -35,18 +35,18 @@
|
||||
#include <linux/swap.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
static void i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *obj);
|
||||
static __must_check int i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *obj);
|
||||
static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
|
||||
static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj);
|
||||
static int i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj,
|
||||
bool write);
|
||||
static int i915_gem_object_set_cpu_read_domain_range(struct drm_i915_gem_object *obj,
|
||||
uint64_t offset,
|
||||
uint64_t size);
|
||||
static __must_check int i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj,
|
||||
bool write);
|
||||
static __must_check int i915_gem_object_set_cpu_read_domain_range(struct drm_i915_gem_object *obj,
|
||||
uint64_t offset,
|
||||
uint64_t size);
|
||||
static void i915_gem_object_set_to_full_cpu_read_domain(struct drm_i915_gem_object *obj);
|
||||
static int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
|
||||
unsigned alignment,
|
||||
bool map_and_fenceable);
|
||||
static __must_check int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
|
||||
unsigned alignment,
|
||||
bool map_and_fenceable);
|
||||
static void i915_gem_clear_fence_reg(struct drm_device *dev,
|
||||
struct drm_i915_fence_reg *reg);
|
||||
static int i915_gem_phys_pwrite(struct drm_device *dev,
|
||||
@@ -1935,6 +1935,8 @@ i915_gem_retire_work_handler(struct work_struct *work)
|
||||
{
|
||||
drm_i915_private_t *dev_priv;
|
||||
struct drm_device *dev;
|
||||
bool idle;
|
||||
int i;
|
||||
|
||||
dev_priv = container_of(work, drm_i915_private_t,
|
||||
mm.retire_work.work);
|
||||
@@ -1948,11 +1950,31 @@ i915_gem_retire_work_handler(struct work_struct *work)
|
||||
|
||||
i915_gem_retire_requests(dev);
|
||||
|
||||
if (!dev_priv->mm.suspended &&
|
||||
(!list_empty(&dev_priv->ring[RCS].request_list) ||
|
||||
!list_empty(&dev_priv->ring[VCS].request_list) ||
|
||||
!list_empty(&dev_priv->ring[BCS].request_list)))
|
||||
/* Send a periodic flush down the ring so we don't hold onto GEM
|
||||
* objects indefinitely.
|
||||
*/
|
||||
idle = true;
|
||||
for (i = 0; i < I915_NUM_RINGS; i++) {
|
||||
struct intel_ring_buffer *ring = &dev_priv->ring[i];
|
||||
|
||||
if (!list_empty(&ring->gpu_write_list)) {
|
||||
struct drm_i915_gem_request *request;
|
||||
int ret;
|
||||
|
||||
ret = i915_gem_flush_ring(dev, ring, 0,
|
||||
I915_GEM_GPU_DOMAINS);
|
||||
request = kzalloc(sizeof(*request), GFP_KERNEL);
|
||||
if (ret || request == NULL ||
|
||||
i915_add_request(dev, NULL, request, ring))
|
||||
kfree(request);
|
||||
}
|
||||
|
||||
idle &= list_empty(&ring->request_list);
|
||||
}
|
||||
|
||||
if (!dev_priv->mm.suspended && !idle)
|
||||
queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
|
||||
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
}
|
||||
|
||||
@@ -2142,25 +2164,37 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
i915_gem_flush_ring(struct drm_device *dev,
|
||||
struct intel_ring_buffer *ring,
|
||||
uint32_t invalidate_domains,
|
||||
uint32_t flush_domains)
|
||||
{
|
||||
ring->flush(ring, invalidate_domains, flush_domains);
|
||||
int ret;
|
||||
|
||||
ret = ring->flush(ring, invalidate_domains, flush_domains);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
i915_gem_process_flushing_list(dev, flush_domains, ring);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_ring_idle(struct drm_device *dev,
|
||||
struct intel_ring_buffer *ring)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (list_empty(&ring->gpu_write_list) && list_empty(&ring->active_list))
|
||||
return 0;
|
||||
|
||||
if (!list_empty(&ring->gpu_write_list))
|
||||
i915_gem_flush_ring(dev, ring,
|
||||
if (!list_empty(&ring->gpu_write_list)) {
|
||||
ret = i915_gem_flush_ring(dev, ring,
|
||||
I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return i915_wait_request(dev,
|
||||
i915_gem_next_request_seqno(dev, ring),
|
||||
ring);
|
||||
@@ -2370,10 +2404,13 @@ i915_gem_object_flush_fence(struct drm_i915_gem_object *obj,
|
||||
int ret;
|
||||
|
||||
if (obj->fenced_gpu_access) {
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS)
|
||||
i915_gem_flush_ring(obj->base.dev,
|
||||
obj->last_fenced_ring,
|
||||
0, obj->base.write_domain);
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) {
|
||||
ret = i915_gem_flush_ring(obj->base.dev,
|
||||
obj->last_fenced_ring,
|
||||
0, obj->base.write_domain);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
obj->fenced_gpu_access = false;
|
||||
}
|
||||
@@ -2393,6 +2430,12 @@ i915_gem_object_flush_fence(struct drm_i915_gem_object *obj,
|
||||
obj->last_fenced_ring = NULL;
|
||||
}
|
||||
|
||||
/* Ensure that all CPU reads are completed before installing a fence
|
||||
* and all writes before removing the fence.
|
||||
*/
|
||||
if (obj->base.read_domains & I915_GEM_DOMAIN_GTT)
|
||||
mb();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2523,9 +2566,12 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj,
|
||||
return ret;
|
||||
} else if (obj->tiling_changed) {
|
||||
if (obj->fenced_gpu_access) {
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS)
|
||||
i915_gem_flush_ring(obj->base.dev, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) {
|
||||
ret = i915_gem_flush_ring(obj->base.dev, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
obj->fenced_gpu_access = false;
|
||||
}
|
||||
@@ -2736,10 +2782,8 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
|
||||
obj->gtt_space = NULL;
|
||||
|
||||
if (ret == -ENOMEM) {
|
||||
/* first try to clear up some space from the GTT */
|
||||
ret = i915_gem_evict_something(dev, size,
|
||||
alignment,
|
||||
map_and_fenceable);
|
||||
/* first try to reclaim some memory by clearing the GTT */
|
||||
ret = i915_gem_evict_everything(dev, false);
|
||||
if (ret) {
|
||||
/* now try to shrink everyone else */
|
||||
if (gfpmask) {
|
||||
@@ -2747,7 +2791,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
|
||||
goto search_free;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
goto search_free;
|
||||
@@ -2762,9 +2806,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
|
||||
drm_mm_put_block(obj->gtt_space);
|
||||
obj->gtt_space = NULL;
|
||||
|
||||
ret = i915_gem_evict_something(dev, size,
|
||||
alignment, map_and_fenceable);
|
||||
if (ret)
|
||||
if (i915_gem_evict_everything(dev, false))
|
||||
return ret;
|
||||
|
||||
goto search_free;
|
||||
@@ -2811,17 +2853,16 @@ i915_gem_clflush_object(struct drm_i915_gem_object *obj)
|
||||
}
|
||||
|
||||
/** Flushes any GPU write domain for the object if it's dirty. */
|
||||
static void
|
||||
static int
|
||||
i915_gem_object_flush_gpu_write_domain(struct drm_i915_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->base.dev;
|
||||
|
||||
if ((obj->base.write_domain & I915_GEM_GPU_DOMAINS) == 0)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
/* Queue the GPU write cache flushing we need. */
|
||||
i915_gem_flush_ring(dev, obj->ring, 0, obj->base.write_domain);
|
||||
BUG_ON(obj->base.write_domain);
|
||||
return i915_gem_flush_ring(dev, obj->ring, 0, obj->base.write_domain);
|
||||
}
|
||||
|
||||
/** Flushes the GTT write domain for the object if it's dirty. */
|
||||
@@ -2833,10 +2874,16 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
|
||||
if (obj->base.write_domain != I915_GEM_DOMAIN_GTT)
|
||||
return;
|
||||
|
||||
/* No actual flushing is required for the GTT write domain. Writes
|
||||
/* No actual flushing is required for the GTT write domain. Writes
|
||||
* to it immediately go to main memory as far as we know, so there's
|
||||
* no chipset flush. It also doesn't land in render cache.
|
||||
*
|
||||
* However, we do have to enforce the order so that all writes through
|
||||
* the GTT land before any writes to the device, such as updates to
|
||||
* the GATT itself.
|
||||
*/
|
||||
wmb();
|
||||
|
||||
i915_gem_release_mmap(obj);
|
||||
|
||||
old_write_domain = obj->base.write_domain;
|
||||
@@ -2882,7 +2929,10 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
|
||||
if (obj->gtt_space == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
i915_gem_object_flush_gpu_write_domain(obj);
|
||||
ret = i915_gem_object_flush_gpu_write_domain(obj);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (obj->pending_gpu_write || write) {
|
||||
ret = i915_gem_object_wait_rendering(obj, true);
|
||||
if (ret)
|
||||
@@ -2927,7 +2977,10 @@ i915_gem_object_set_to_display_plane(struct drm_i915_gem_object *obj,
|
||||
if (obj->gtt_space == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
i915_gem_object_flush_gpu_write_domain(obj);
|
||||
ret = i915_gem_object_flush_gpu_write_domain(obj);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
/* Currently, we are always called from an non-interruptible context. */
|
||||
if (pipelined != obj->ring) {
|
||||
@@ -2952,12 +3005,17 @@ int
|
||||
i915_gem_object_flush_gpu(struct drm_i915_gem_object *obj,
|
||||
bool interruptible)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!obj->active)
|
||||
return 0;
|
||||
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS)
|
||||
i915_gem_flush_ring(obj->base.dev, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) {
|
||||
ret = i915_gem_flush_ring(obj->base.dev, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return i915_gem_object_wait_rendering(obj, interruptible);
|
||||
}
|
||||
@@ -2974,7 +3032,10 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
|
||||
uint32_t old_write_domain, old_read_domains;
|
||||
int ret;
|
||||
|
||||
i915_gem_object_flush_gpu_write_domain(obj);
|
||||
ret = i915_gem_object_flush_gpu_write_domain(obj);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = i915_gem_object_wait_rendering(obj, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -3069,7 +3130,10 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_i915_gem_object *obj,
|
||||
if (offset == 0 && size == obj->base.size)
|
||||
return i915_gem_object_set_to_cpu_domain(obj, 0);
|
||||
|
||||
i915_gem_object_flush_gpu_write_domain(obj);
|
||||
ret = i915_gem_object_flush_gpu_write_domain(obj);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = i915_gem_object_wait_rendering(obj, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -3362,8 +3426,8 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
|
||||
* flush earlier is beneficial.
|
||||
*/
|
||||
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) {
|
||||
i915_gem_flush_ring(dev, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
ret = i915_gem_flush_ring(dev, obj->ring,
|
||||
0, obj->base.write_domain);
|
||||
} else if (obj->ring->outstanding_lazy_request ==
|
||||
obj->last_rendering_seqno) {
|
||||
struct drm_i915_gem_request *request;
|
||||
|
||||
@@ -127,9 +127,15 @@ i915_gem_evict_something(struct drm_device *dev, int min_size,
|
||||
}
|
||||
|
||||
/* Nothing found, clean up and bail out! */
|
||||
list_for_each_entry(obj, &unwind_list, exec_list) {
|
||||
while (!list_empty(&unwind_list)) {
|
||||
obj = list_first_entry(&unwind_list,
|
||||
struct drm_i915_gem_object,
|
||||
exec_list);
|
||||
|
||||
ret = drm_mm_scan_remove_block(obj->gtt_space);
|
||||
BUG_ON(ret);
|
||||
|
||||
list_del_init(&obj->exec_list);
|
||||
drm_gem_object_unreference(&obj->base);
|
||||
}
|
||||
|
||||
@@ -162,6 +168,7 @@ found:
|
||||
exec_list);
|
||||
if (ret == 0)
|
||||
ret = i915_gem_object_unbind(obj);
|
||||
|
||||
list_del_init(&obj->exec_list);
|
||||
drm_gem_object_unreference(&obj->base);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,6 @@ eb_destroy(struct eb_objects *eb)
|
||||
static int
|
||||
i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
|
||||
struct eb_objects *eb,
|
||||
struct drm_i915_gem_exec_object2 *entry,
|
||||
struct drm_i915_gem_relocation_entry *reloc)
|
||||
{
|
||||
struct drm_device *dev = obj->base.dev;
|
||||
@@ -411,10 +410,10 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
|
||||
|
||||
static int
|
||||
i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj,
|
||||
struct eb_objects *eb,
|
||||
struct drm_i915_gem_exec_object2 *entry)
|
||||
struct eb_objects *eb)
|
||||
{
|
||||
struct drm_i915_gem_relocation_entry __user *user_relocs;
|
||||
struct drm_i915_gem_exec_object2 *entry = obj->exec_entry;
|
||||
int i, ret;
|
||||
|
||||
user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr;
|
||||
@@ -426,7 +425,7 @@ i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj,
|
||||
sizeof(reloc)))
|
||||
return -EFAULT;
|
||||
|
||||
ret = i915_gem_execbuffer_relocate_entry(obj, eb, entry, &reloc);
|
||||
ret = i915_gem_execbuffer_relocate_entry(obj, eb, &reloc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -442,13 +441,13 @@ i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj,
|
||||
static int
|
||||
i915_gem_execbuffer_relocate_object_slow(struct drm_i915_gem_object *obj,
|
||||
struct eb_objects *eb,
|
||||
struct drm_i915_gem_exec_object2 *entry,
|
||||
struct drm_i915_gem_relocation_entry *relocs)
|
||||
{
|
||||
const struct drm_i915_gem_exec_object2 *entry = obj->exec_entry;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < entry->relocation_count; i++) {
|
||||
ret = i915_gem_execbuffer_relocate_entry(obj, eb, entry, &relocs[i]);
|
||||
ret = i915_gem_execbuffer_relocate_entry(obj, eb, &relocs[i]);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
@@ -459,8 +458,7 @@ i915_gem_execbuffer_relocate_object_slow(struct drm_i915_gem_object *obj,
|
||||
static int
|
||||
i915_gem_execbuffer_relocate(struct drm_device *dev,
|
||||
struct eb_objects *eb,
|
||||
struct list_head *objects,
|
||||
struct drm_i915_gem_exec_object2 *exec)
|
||||
struct list_head *objects)
|
||||
{
|
||||
struct drm_i915_gem_object *obj;
|
||||
int ret;
|
||||
@@ -468,7 +466,7 @@ i915_gem_execbuffer_relocate(struct drm_device *dev,
|
||||
list_for_each_entry(obj, objects, exec_list) {
|
||||
obj->base.pending_read_domains = 0;
|
||||
obj->base.pending_write_domain = 0;
|
||||
ret = i915_gem_execbuffer_relocate_object(obj, eb, exec++);
|
||||
ret = i915_gem_execbuffer_relocate_object(obj, eb);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
@@ -479,13 +477,36 @@ i915_gem_execbuffer_relocate(struct drm_device *dev,
|
||||
static int
|
||||
i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
|
||||
struct drm_file *file,
|
||||
struct list_head *objects,
|
||||
struct drm_i915_gem_exec_object2 *exec)
|
||||
struct list_head *objects)
|
||||
{
|
||||
struct drm_i915_gem_object *obj;
|
||||
struct drm_i915_gem_exec_object2 *entry;
|
||||
int ret, retry;
|
||||
bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4;
|
||||
struct list_head ordered_objects;
|
||||
|
||||
INIT_LIST_HEAD(&ordered_objects);
|
||||
while (!list_empty(objects)) {
|
||||
struct drm_i915_gem_exec_object2 *entry;
|
||||
bool need_fence, need_mappable;
|
||||
|
||||
obj = list_first_entry(objects,
|
||||
struct drm_i915_gem_object,
|
||||
exec_list);
|
||||
entry = obj->exec_entry;
|
||||
|
||||
need_fence =
|
||||
has_fenced_gpu_access &&
|
||||
entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
|
||||
obj->tiling_mode != I915_TILING_NONE;
|
||||
need_mappable =
|
||||
entry->relocation_count ? true : need_fence;
|
||||
|
||||
if (need_mappable)
|
||||
list_move(&obj->exec_list, &ordered_objects);
|
||||
else
|
||||
list_move_tail(&obj->exec_list, &ordered_objects);
|
||||
}
|
||||
list_splice(&ordered_objects, objects);
|
||||
|
||||
/* Attempt to pin all of the buffers into the GTT.
|
||||
* This is done in 3 phases:
|
||||
@@ -504,14 +525,11 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
|
||||
ret = 0;
|
||||
|
||||
/* Unbind any ill-fitting objects or pin. */
|
||||
entry = exec;
|
||||
list_for_each_entry(obj, objects, exec_list) {
|
||||
struct drm_i915_gem_exec_object2 *entry = obj->exec_entry;
|
||||
bool need_fence, need_mappable;
|
||||
|
||||
if (!obj->gtt_space) {
|
||||
entry++;
|
||||
if (!obj->gtt_space)
|
||||
continue;
|
||||
}
|
||||
|
||||
need_fence =
|
||||
has_fenced_gpu_access &&
|
||||
@@ -534,8 +552,8 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
|
||||
}
|
||||
|
||||
/* Bind fresh objects */
|
||||
entry = exec;
|
||||
list_for_each_entry(obj, objects, exec_list) {
|
||||
struct drm_i915_gem_exec_object2 *entry = obj->exec_entry;
|
||||
bool need_fence;
|
||||
|
||||
need_fence =
|
||||
@@ -570,7 +588,6 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
|
||||
}
|
||||
|
||||
entry->offset = obj->gtt_offset;
|
||||
entry++;
|
||||
}
|
||||
|
||||
/* Decrement pin count for bound objects */
|
||||
@@ -622,7 +639,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
|
||||
int i, total, ret;
|
||||
|
||||
/* We may process another execbuffer during the unlock... */
|
||||
while (list_empty(objects)) {
|
||||
while (!list_empty(objects)) {
|
||||
obj = list_first_entry(objects,
|
||||
struct drm_i915_gem_object,
|
||||
exec_list);
|
||||
@@ -665,7 +682,6 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
|
||||
}
|
||||
|
||||
/* reacquire the objects */
|
||||
INIT_LIST_HEAD(objects);
|
||||
eb_reset(eb);
|
||||
for (i = 0; i < count; i++) {
|
||||
struct drm_i915_gem_object *obj;
|
||||
@@ -681,10 +697,11 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
|
||||
|
||||
list_add_tail(&obj->exec_list, objects);
|
||||
obj->exec_handle = exec[i].handle;
|
||||
obj->exec_entry = &exec[i];
|
||||
eb_add_object(eb, obj);
|
||||
}
|
||||
|
||||
ret = i915_gem_execbuffer_reserve(ring, file, objects, exec);
|
||||
ret = i915_gem_execbuffer_reserve(ring, file, objects);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
@@ -693,7 +710,6 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
|
||||
obj->base.pending_read_domains = 0;
|
||||
obj->base.pending_write_domain = 0;
|
||||
ret = i915_gem_execbuffer_relocate_object_slow(obj, eb,
|
||||
exec,
|
||||
reloc + total);
|
||||
if (ret)
|
||||
goto err;
|
||||
@@ -713,25 +729,34 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
i915_gem_execbuffer_flush(struct drm_device *dev,
|
||||
uint32_t invalidate_domains,
|
||||
uint32_t flush_domains,
|
||||
uint32_t flush_rings)
|
||||
{
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
int i;
|
||||
int i, ret;
|
||||
|
||||
if (flush_domains & I915_GEM_DOMAIN_CPU)
|
||||
intel_gtt_chipset_flush();
|
||||
|
||||
if (flush_domains & I915_GEM_DOMAIN_GTT)
|
||||
wmb();
|
||||
|
||||
if ((flush_domains | invalidate_domains) & I915_GEM_GPU_DOMAINS) {
|
||||
for (i = 0; i < I915_NUM_RINGS; i++)
|
||||
if (flush_rings & (1 << i))
|
||||
i915_gem_flush_ring(dev, &dev_priv->ring[i],
|
||||
invalidate_domains,
|
||||
flush_domains);
|
||||
if (flush_rings & (1 << i)) {
|
||||
ret = i915_gem_flush_ring(dev,
|
||||
&dev_priv->ring[i],
|
||||
invalidate_domains,
|
||||
flush_domains);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -795,10 +820,12 @@ i915_gem_execbuffer_move_to_gpu(struct intel_ring_buffer *ring,
|
||||
cd.invalidate_domains,
|
||||
cd.flush_domains);
|
||||
#endif
|
||||
i915_gem_execbuffer_flush(ring->dev,
|
||||
cd.invalidate_domains,
|
||||
cd.flush_domains,
|
||||
cd.flush_rings);
|
||||
ret = i915_gem_execbuffer_flush(ring->dev,
|
||||
cd.invalidate_domains,
|
||||
cd.flush_domains,
|
||||
cd.flush_rings);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
list_for_each_entry(obj, objects, exec_list) {
|
||||
@@ -921,7 +948,7 @@ i915_gem_execbuffer_retire_commands(struct drm_device *dev,
|
||||
struct intel_ring_buffer *ring)
|
||||
{
|
||||
struct drm_i915_gem_request *request;
|
||||
u32 flush_domains;
|
||||
u32 invalidate;
|
||||
|
||||
/*
|
||||
* Ensure that the commands in the batch buffer are
|
||||
@@ -929,11 +956,13 @@ i915_gem_execbuffer_retire_commands(struct drm_device *dev,
|
||||
*
|
||||
* The sampler always gets flushed on i965 (sigh).
|
||||
*/
|
||||
flush_domains = 0;
|
||||
invalidate = I915_GEM_DOMAIN_COMMAND;
|
||||
if (INTEL_INFO(dev)->gen >= 4)
|
||||
flush_domains |= I915_GEM_DOMAIN_SAMPLER;
|
||||
|
||||
ring->flush(ring, I915_GEM_DOMAIN_COMMAND, flush_domains);
|
||||
invalidate |= I915_GEM_DOMAIN_SAMPLER;
|
||||
if (ring->flush(ring, invalidate, 0)) {
|
||||
i915_gem_next_request_seqno(dev, ring);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Add a breadcrumb for the completion of the batch buffer */
|
||||
request = kzalloc(sizeof(*request), GFP_KERNEL);
|
||||
@@ -1098,16 +1127,22 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
|
||||
list_add_tail(&obj->exec_list, &objects);
|
||||
obj->exec_handle = exec[i].handle;
|
||||
obj->exec_entry = &exec[i];
|
||||
eb_add_object(eb, obj);
|
||||
}
|
||||
|
||||
/* take note of the batch buffer before we might reorder the lists */
|
||||
batch_obj = list_entry(objects.prev,
|
||||
struct drm_i915_gem_object,
|
||||
exec_list);
|
||||
|
||||
/* Move the objects en-masse into the GTT, evicting if necessary. */
|
||||
ret = i915_gem_execbuffer_reserve(ring, file, &objects, exec);
|
||||
ret = i915_gem_execbuffer_reserve(ring, file, &objects);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
/* The objects are in their final locations, apply the relocations. */
|
||||
ret = i915_gem_execbuffer_relocate(dev, eb, &objects, exec);
|
||||
ret = i915_gem_execbuffer_relocate(dev, eb, &objects);
|
||||
if (ret) {
|
||||
if (ret == -EFAULT) {
|
||||
ret = i915_gem_execbuffer_relocate_slow(dev, file, ring,
|
||||
@@ -1121,9 +1156,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
}
|
||||
|
||||
/* Set the pending read domains for the batch buffer to COMMAND */
|
||||
batch_obj = list_entry(objects.prev,
|
||||
struct drm_i915_gem_object,
|
||||
exec_list);
|
||||
if (batch_obj->base.pending_write_domain) {
|
||||
DRM_ERROR("Attempting to use self-modifying batch buffer\n");
|
||||
ret = -EINVAL;
|
||||
@@ -1340,4 +1372,3 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
|
||||
drm_free_large(exec2_list);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,15 +85,11 @@ int i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj)
|
||||
|
||||
void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj)
|
||||
{
|
||||
struct drm_device *dev = obj->base.dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
if (dev_priv->mm.gtt->needs_dmar) {
|
||||
intel_gtt_unmap_memory(obj->sg_list, obj->num_sg);
|
||||
obj->sg_list = NULL;
|
||||
obj->num_sg = 0;
|
||||
}
|
||||
|
||||
intel_gtt_clear_range(obj->gtt_space->start >> PAGE_SHIFT,
|
||||
obj->base.size >> PAGE_SHIFT);
|
||||
|
||||
if (obj->sg_list) {
|
||||
intel_gtt_unmap_memory(obj->sg_list, obj->num_sg);
|
||||
obj->sg_list = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user