aboutsummaryrefslogblamecommitdiffstats
path: root/init/Kconfig
blob: 9a7656f0b5ecff5a1d83e3a547ad6aafc08dfdc5 (plain) (tree)
1
2
3
4
5
6
7
8







                                                     
































                                                                              

             












                                 

                          
            

                                                                    














                                                                        















                                                                              





                                                                           
                                                                          




                                                                         























































                                                                              












                                                                            

                                                              
                            







                                                                           

                               
                      







                                                                      
                                                                                   



                                                                      

                                                                           
 






















                                                                            
                                                                  





                                                                         










                                                                        

                    



                                                                 








                                                                             







                                                                     























                                                                                                                                                                             













                                                                                

                                                                            













                                                                              
 








                                                                               









                                                                      









                                                                              





                                                                             










                                                                      
                         











                                                                             










                                                                               








                                                                      








                                                                     

                               



                    








                               



                     








































                                                                             
                  

                                        






































                                                                          



                      
config DEFCONFIG_LIST
	string
	option defconfig_list
	default "/lib/modules/$UNAME_RELEASE/.config"
	default "/etc/kernel-config"
	default "/boot/config-$UNAME_RELEASE"
	default "arch/$ARCH/defconfig"

menu "Code maturity level options"

config EXPERIMENTAL
	bool "Prompt for development and/or incomplete code/drivers"
	---help---
	  Some of the various things that Linux supports (such as network
	  drivers, file systems, network protocols, etc.) can be in a state
	  of development where the functionality, stability, or the level of
	  testing is not yet high enough for general use. This is usually
	  known as the "alpha-test" phase among developers. If a feature is
	  currently in alpha-test, then the developers usually discourage
	  uninformed widespread use of this feature by the general public to
	  avoid "Why doesn't this work?" type mail messages. However, active
	  testing and use of these systems is welcomed. Just be aware that it
	  may not meet the normal level of reliability or it may fail to work
	  in some special cases. Detailed bug reports from people familiar
	  with the kernel internals are usually welcomed by the developers
	  (before submitting bug reports, please read the documents
	  <file:README>, <file:MAINTAINERS>, <file:REPORTING-BUGS>,
	  <file:Documentation/BUG-HUNTING>, and
	  <file:Documentation/oops-tracing.txt> in the kernel source).

	  This option will also make obsoleted drivers available. These are
	  drivers that have been replaced by something else, and/or are
	  scheduled to be removed in a future kernel release.

	  Unless you intend to help test and develop a feature or driver that
	  falls into this category, or you have a situation that requires
	  using these features, you should probably say N here, which will
	  cause the configurator to present you with fewer choices. If
	  you say Y here, you will be offered the choice of using features or
	  drivers that are currently considered to be in the alpha-test phase.

config BROKEN
	bool

config BROKEN_ON_SMP
	bool
	depends on BROKEN || !SMP
	default y

config LOCK_KERNEL
	bool
	depends on SMP || PREEMPT
	default y

config INIT_ENV_ARG_LIMIT
	int
	default 32 if !UML
	default 128 if UML
	help
	  Maximum of each of the number of arguments and environment
	  variables passed to init from the kernel command line.

endmenu

menu "General setup"

config LOCALVERSION
	string "Local version - append to kernel release"
	help
	  Append an extra string to the end of your kernel version.
	  This will show up when you type uname, for example.
	  The string you set here will be appended after the contents of
	  any files with a filename matching localversion* in your
	  object and source tree, in that order.  Your total string can
	  be a maximum of 64 characters.

config LOCALVERSION_AUTO
	bool "Automatically append version information to the version string"
	default y
	help
	  This will try to automatically determine if the current tree is a
	  release tree by looking for git tags that
	  belong to the current top of tree revision.

	  A string of the format -gxxxxxxxx will be added to the localversion
	  if a git based tree is found.  The string generated by this will be
	  appended after any matching localversion* files, and after the value
	  set in CONFIG_LOCALVERSION

	  Note: This requires Perl, and a git repository, but not necessarily
	  the git or cogito tools to be installed.

config SWAP
	bool "Support for paging of anonymous memory (swap)"
	depends on MMU
	default y
	help
	  This option allows you to choose whether you want to have support
	  for so called swap devices or swap files in your kernel that are
	  used to provide more virtual memory than the actual RAM present
	  in your computer.  If unsure say Y.

config SYSVIPC
	bool "System V IPC"
	---help---
	  Inter Process Communication is a suite of library functions and
	  system calls which let processes (running programs) synchronize and
	  exchange information. It is generally considered to be a good thing,
	  and some programs won't run unless you say Y here. In particular, if
	  you want to run the DOS emulator dosemu under Linux (read the
	  DOSEMU-HOWTO, available from <http://www.tldp.org/docs.html#howto>),
	  you'll need to say Y here.

	  You can find documentation about IPC with "info ipc" and also in
	  section 6.4 of the Linux Programmer's Guide, available from
	  <http://www.tldp.org/guides.html>.

config POSIX_MQUEUE
	bool "POSIX Message Queues"
	depends on NET && EXPERIMENTAL
	---help---
	  POSIX variant of message queues is a part of IPC. In POSIX message
	  queues every message has a priority which decides about succession
	  of receiving it by a process. If you want to compile and run
	  programs written e.g. for Solaris with use of its POSIX message
	  queues (functions mq_*) say Y here. To use this feature you will
	  also need mqueue library, available from
	  <http://www.mat.uni.torun.pl/~wrona/posix_ipc/>

	  POSIX message queues are visible as a filesystem called 'mqueue'
	  and can be mounted somewhere if you want to do filesystem
	  operations on message queues.

	  If unsure, say Y.

config BSD_PROCESS_ACCT
	bool "BSD Process Accounting"
	help
	  If you say Y here, a user level program will be able to instruct the
	  kernel (via a special system call) to write process accounting
	  information to a file: whenever a process exits, information about
	  that process will be appended to the file by the kernel.  The
	  information includes things such as creation time, owning user,
	  command name, memory usage, controlling terminal etc. (the complete
	  list is in the struct acct in <file:include/linux/acct.h>).  It is
	  up to the user level program to do useful things with this
	  information.  This is generally a good idea, so say Y.

config BSD_PROCESS_ACCT_V3
	bool "BSD Process Accounting version 3 file format"
	depends on BSD_PROCESS_ACCT
	default n
	help
	  If you say Y here, the process accounting information is written
	  in a new file format that also logs the process IDs of each
	  process and it's parent. Note that this file format is incompatible
	  with previous v0/v1/v2 file formats, so you will need updated tools
	  for processing it. A preliminary version of these tools is available
	  at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>.

config TASKSTATS
	bool "Export task/process statistics through netlink (EXPERIMENTAL)"
	depends on NET
	default n
	help
	  Export selected statistics for tasks/processes through the
	  generic netlink interface. Unlike BSD process accounting, the
	  statistics are available during the lifetime of tasks/processes as
	  responses to commands. Like BSD accounting, they are sent to user
	  space on task exit.

	  Say N if unsure.

config TASK_DELAY_ACCT
	bool "Enable per-task delay accounting (EXPERIMENTAL)"
	depends on TASKSTATS
	help
	  Collect information on time spent by a task waiting for system
	  resources like cpu, synchronous block I/O completion and swapping
	  in pages. Such statistics can help in setting a task's priorities
	  relative to other tasks for cpu, io, rss limits etc.

	  Say N if unsure.

config AUDIT
	bool "Auditing support"
	depends on NET
	help
	  Enable auditing infrastructure that can be used with another
	  kernel subsystem, such as SELinux (which requires this for
	  logging of avc messages output).  Does not do system-call
	  auditing without CONFIG_AUDITSYSCALL.

config AUDITSYSCALL
	bool "Enable system-call auditing support"
	depends on AUDIT && (X86 || PPC || PPC64 || S390 || IA64 || UML || SPARC64)
	default y if SECURITY_SELINUX
	help
	  Enable low-overhead system-call auditing infrastructure that
	  can be used independently or with another kernel subsystem,
	  such as SELinux.  To use audit's filesystem watch feature, please
	  ensure that INOTIFY is configured.

config IKCONFIG
	bool "Kernel .config support"
	---help---
	  This option enables the complete Linux kernel ".config" file
	  contents to be saved in the kernel. It provides documentation
	  of which kernel options are used in a running kernel or in an
	  on-disk kernel.  This information can be extracted from the kernel
	  image file with the script scripts/extract-ikconfig and used as
	  input to rebuild the current kernel or to build another kernel.
	  It can also be extracted from a running kernel by reading
	  /proc/config.gz if enabled (below).

config IKCONFIG_PROC
	bool "Enable access to .config through /proc/config.gz"
	depends on IKCONFIG && PROC_FS
	---help---
	  This option enables access to the kernel configuration file
	  through /proc/config.gz.

config CPUSETS
	bool "Cpuset support"
	depends on SMP
	help
	  This option will let you create and manage CPUSETs which
	  allow dynamically partitioning a system into sets of CPUs and
	  Memory Nodes and assigning tasks to run only within those sets.
	  This is primarily useful on large SMP or NUMA systems.

	  Say N if unsure.

config RELAY
	bool "Kernel->user space relay support (formerly relayfs)"
	help
	  This option enables support for relay interface support in
	  certain file systems (such as debugfs).
	  It is designed to provide an efficient mechanism for tools and
	  facilities to relay large amounts of data from kernel space to
	  user space.

	  If unsure, say N.

source "usr/Kconfig"

config CC_OPTIMIZE_FOR_SIZE
	bool "Optimize for size (Look out for broken compilers!)"
	default y
	depends on ARM || H8300 || EXPERIMENTAL
	help
	  Enabling this option will pass "-Os" instead of "-O2" to gcc
	  resulting in a smaller kernel.

	  WARNING: some versions of gcc may generate incorrect code with this
	  option.  If problems are observed, a gcc upgrade may be needed.

	  If unsure, say N.

menuconfig EMBEDDED
	bool "Configure standard kernel features (for small systems)"
	help
	  This option allows certain base kernel options and settings
          to be disabled or tweaked. This is for specialized
          environments which can tolerate a "non-standard" kernel.
          Only use this if you really know what you are doing.

config UID16
	bool "Enable 16-bit UID system calls" if EMBEDDED
	depends on ARM || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && SPARC32_COMPAT) || UML || (X86_64 && IA32_EMULATION)
	default y
	help
	  This enables the legacy 16-bit UID syscall wrappers.

config SYSCTL
	bool "Sysctl support" if EMBEDDED
	default y
	---help---
	  The sysctl interface provides a means of dynamically changing
	  certain kernel parameters and variables on the fly without requiring
	  a recompile of the kernel or reboot of the system.  The primary
	  interface consists of a system call, but if you say Y to "/proc
	  file system support", a tree of modifiable sysctl entries will be
	  generated beneath the /proc/sys directory. They are explained in the
	  files in <file:Documentation/sysctl/>.  Note that enabling this
	  option will enlarge the kernel by at least 8 KB.

	  As it is generally a good thing, you should say Y here unless
	  building a kernel for install/rescue disks or your system is very
	  limited in memory.

config KALLSYMS
	 bool "Load all symbols for debugging/kksymoops" if EMBEDDED
	 default y
	 help
	   Say Y here to let the kernel print out symbolic crash information and
	   symbolic stack backtraces. This increases the size of the kernel
	   somewhat, as all symbols have to be loaded into the kernel image.

config KALLSYMS_ALL
	bool "Include all symbols in kallsyms"
	depends on DEBUG_KERNEL && KALLSYMS
	help
	   Normally kallsyms only contains the symbols of functions, for nicer
	   OOPS messages.  Some debuggers can use kallsyms for other
	   symbols too: say Y here to include all symbols, if you need them 
	   and you don't care about adding 300k to the size of your kernel.

	   Say N.

config KALLSYMS_EXTRA_PASS
	bool "Do an extra kallsyms pass"
	depends on KALLSYMS
	help
	   If kallsyms is not working correctly, the build will fail with
	   inconsistent kallsyms data.  If that occurs, log a bug report and
	   turn on KALLSYMS_EXTRA_PASS which should result in a stable build.
	   Always say N here unless you find a bug in kallsyms, which must be
	   reported.  KALLSYMS_EXTRA_PASS is only a temporary workaround while
	   you wait for kallsyms to be fixed.


config HOTPLUG
	bool "Support for hot-pluggable devices" if EMBEDDED
	default y
	help
	  This option is provided for the case where no hotplug or uevent
	  capabilities is wanted by the kernel.  You should only consider
	  disabling this option for embedded systems that do not use modules, a
	  dynamic /dev tree, or dynamic device discovery.  Just say Y.

config PRINTK
	default y
	bool "Enable support for printk" if EMBEDDED
	help
	  This option enables normal printk support. Removing it
	  eliminates most of the message strings from the kernel image
	  and makes the kernel more or less silent. As this makes it
	  very difficult to diagnose system problems, saying N here is
	  strongly discouraged.

config BUG
	bool "BUG() support" if EMBEDDED
	default y
	help
          Disabling this option eliminates support for BUG and WARN, reducing
          the size of your kernel image and potentially quietly ignoring
          numerous fatal conditions. You should only consider disabling this
          option for embedded systems with no facilities for reporting errors.
          Just say Y.

config ELF_CORE
	default y
	bool "Enable ELF core dumps" if EMBEDDED
	help
	  Enable support for generating core dumps. Disabling saves about 4k.

config BASE_FULL
	default y
	bool "Enable full-sized data structures for core" if EMBEDDED
	help
	  Disabling this option reduces the size of miscellaneous core
	  kernel data structures. This saves memory on small machines,
	  but may reduce performance.

config FUTEX
	bool "Enable futex support" if EMBEDDED
	default y
	select RT_MUTEXES
	help
	  Disabling this option will cause the kernel to be built without
	  support for "fast userspace mutexes".  The resulting kernel may not
	  run glibc-based applications correctly.

config EPOLL
	bool "Enable eventpoll support" if EMBEDDED
	default y
	help
	  Disabling this option will cause the kernel to be built without
	  support for epoll family of system calls.

config SHMEM
	bool "Use full shmem filesystem" if EMBEDDED
	default y
	depends on MMU
	help
	  The shmem is an internal filesystem used to manage shared memory.
	  It is backed by swap and manages resource limits. It is also exported
	  to userspace as tmpfs if TMPFS is enabled. Disabling this
	  option replaces shmem and tmpfs with the much simpler ramfs code,
	  which may be appropriate on small systems without swap.

config SLAB
	default y
	bool "Use full SLAB allocator" if EMBEDDED
	help
	  Disabling this replaces the advanced SLAB allocator and
	  kmalloc support with the drastically simpler SLOB allocator.
	  SLOB is more space efficient but does not scale well and is
	  more susceptible to fragmentation.

config VM_EVENT_COUNTERS
	default y
	bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
	help
	  VM event counters are only needed to for event counts to be
	  shown. They have no function for the kernel itself. This
	  option allows the disabling of the VM event counters.
	  /proc/vmstat will only show page counts.

endmenu		# General setup

config RT_MUTEXES
	boolean
	select PLIST

config TINY_SHMEM
	default !SHMEM
	bool

config BASE_SMALL
	int
	default 0 if BASE_FULL
	default 1 if !BASE_FULL

config SLOB
	default !SLAB
	bool

menu "Loadable module support"

config MODULES
	bool "Enable loadable module support"
	help
	  Kernel modules are small pieces of compiled code which can
	  be inserted in the running kernel, rather than being
	  permanently built into the kernel.  You use the "modprobe"
	  tool to add (and sometimes remove) them.  If you say Y here,
	  many parts of the kernel can be built as modules (by
	  answering M instead of Y where indicated): this is most
	  useful for infrequently used options which are not required
	  for booting.  For more information, see the man pages for
	  modprobe, lsmod, modinfo, insmod and rmmod.

	  If you say Y here, you will need to run "make
	  modules_install" to put the modules under /lib/modules/
	  where modprobe can find them (you may need to be root to do
	  this).

	  If unsure, say Y.

config MODULE_UNLOAD
	bool "Module unloading"
	depends on MODULES
	help
	  Without this option you will not be able to unload any
	  modules (note that some modules may not be unloadable
	  anyway), which makes your kernel slightly smaller and
	  simpler.  If unsure, say Y.

config MODULE_FORCE_UNLOAD
	bool "Forced module unloading"
	depends on MODULE_UNLOAD && EXPERIMENTAL
	help
	  This option allows you to force a module to unload, even if the
	  kernel believes it is unsafe: the kernel will remove the module
	  without waiting for anyone to stop using it (using the -f option to
	  rmmod).  This is mainly for kernel developers and desperate users.
	  If unsure, say N.

config MODVERSIONS
	bool "Module versioning support"
	depends on MODULES
	help
	  Usually, you have to use modules compiled with your kernel.
	  Saying Y here makes it sometimes possible to use modules
	  compiled for different kernels, by adding enough information
	  to the modules to (hopefully) spot any changes which would
	  make them incompatible with the kernel you are running.  If
	  unsure, say N.

config MODULE_SRCVERSION_ALL
	bool "Source checksum for all modules"
	depends on MODULES
	help
	  Modules which contain a MODULE_VERSION get an extra "srcversion"
	  field inserted into their modinfo section, which contains a
    	  sum of the source files which made it.  This helps maintainers
	  see exactly which source was used to build a module (since
	  others sometimes change the module source without updating
	  the version).  With this option, such a "srcversion" field
	  will be created for all modules.  If unsure, say N.

config KMOD
	bool "Automatic kernel module loading"
	depends on MODULES
	help
	  Normally when you have selected some parts of the kernel to
	  be created as kernel modules, you must load them (using the
	  "modprobe" command) before you can use them. If you say Y
	  here, some parts of the kernel will be able to load modules
	  automatically: when a part of the kernel needs a module, it
	  runs modprobe with the appropriate arguments, thereby
	  loading the module if it is available.  If unsure, say Y.

config STOP_MACHINE
	bool
	default y
	depends on (SMP && MODULE_UNLOAD) || HOTPLUG_CPU
	help
	  Need stop_machine() primitive.
endmenu

menu "Block layer"
source "block/Kconfig"
endmenu
struct drm_device *); int (*create_context)(struct nouveau_channel *); void (*destroy_context)(struct nouveau_channel *); int (*load_context)(struct nouveau_channel *); int (*unload_context)(struct drm_device *); }; struct nouveau_pgraph_object_method { int id; int (*exec)(struct nouveau_channel *chan, int grclass, int mthd, uint32_t data); }; struct nouveau_pgraph_object_class { int id; bool software; struct nouveau_pgraph_object_method *methods; }; struct nouveau_pgraph_engine { struct nouveau_pgraph_object_class *grclass; bool accel_blocked; void *ctxprog; void *ctxvals; int grctx_size; int (*init)(struct drm_device *); void (*takedown)(struct drm_device *); void (*fifo_access)(struct drm_device *, bool); struct nouveau_channel *(*channel)(struct drm_device *); int (*create_context)(struct nouveau_channel *); void (*destroy_context)(struct nouveau_channel *); int (*load_context)(struct nouveau_channel *); int (*unload_context)(struct drm_device *); void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr, uint32_t size, uint32_t pitch); }; struct nouveau_engine { struct nouveau_instmem_engine instmem; struct nouveau_mc_engine mc; struct nouveau_timer_engine timer; struct nouveau_fb_engine fb; struct nouveau_pgraph_engine graph; struct nouveau_fifo_engine fifo; }; struct nouveau_pll_vals { union { struct { #ifdef __BIG_ENDIAN uint8_t N1, M1, N2, M2; #else uint8_t M1, N1, M2, N2; #endif }; struct { uint16_t NM1, NM2; } __attribute__((packed)); }; int log2P; int refclk; }; enum nv04_fp_display_regs { FP_DISPLAY_END, FP_TOTAL, FP_CRTC, FP_SYNC_START, FP_SYNC_END, FP_VALID_START, FP_VALID_END }; struct nv04_crtc_reg { unsigned char MiscOutReg; /* */ uint8_t CRTC[0x9f]; uint8_t CR58[0x10]; uint8_t Sequencer[5]; uint8_t Graphics[9]; uint8_t Attribute[21]; unsigned char DAC[768]; /* Internal Colorlookuptable */ /* PCRTC regs */ uint32_t fb_start; uint32_t crtc_cfg; uint32_t cursor_cfg; uint32_t gpio_ext; uint32_t crtc_830; uint32_t crtc_834; uint32_t crtc_850; uint32_t crtc_eng_ctrl; /* PRAMDAC regs */ uint32_t nv10_cursync; struct nouveau_pll_vals pllvals; uint32_t ramdac_gen_ctrl; uint32_t ramdac_630; uint32_t ramdac_634; uint32_t tv_setup; uint32_t tv_vtotal; uint32_t tv_vskew; uint32_t tv_vsync_delay; uint32_t tv_htotal; uint32_t tv_hskew; uint32_t tv_hsync_delay; uint32_t tv_hsync_delay2; uint32_t fp_horiz_regs[7]; uint32_t fp_vert_regs[7]; uint32_t dither; uint32_t fp_control; uint32_t dither_regs[6]; uint32_t fp_debug_0; uint32_t fp_debug_1; uint32_t fp_debug_2; uint32_t fp_margin_color; uint32_t ramdac_8c0; uint32_t ramdac_a20; uint32_t ramdac_a24; uint32_t ramdac_a34; uint32_t ctv_regs[38]; }; struct nv04_output_reg { uint32_t output; int head; }; struct nv04_mode_state { uint32_t bpp; uint32_t width; uint32_t height; uint32_t interlace; uint32_t repaint0; uint32_t repaint1; uint32_t screen; uint32_t scale; uint32_t dither; uint32_t extra; uint32_t fifo; uint32_t pixel; uint32_t horiz; int arbitration0; int arbitration1; uint32_t pll; uint32_t pllB; uint32_t vpll; uint32_t vpll2; uint32_t vpllB; uint32_t vpll2B; uint32_t pllsel; uint32_t sel_clk; uint32_t general; uint32_t crtcOwner; uint32_t head; uint32_t head2; uint32_t cursorConfig; uint32_t cursor0; uint32_t cursor1; uint32_t cursor2; uint32_t timingH; uint32_t timingV; uint32_t displayV; uint32_t crtcSync; struct nv04_crtc_reg crtc_reg[2]; }; enum nouveau_card_type { NV_04 = 0x00, NV_10 = 0x10, NV_20 = 0x20, NV_30 = 0x30, NV_40 = 0x40, NV_50 = 0x50, }; struct drm_nouveau_private { struct drm_device *dev; enum { NOUVEAU_CARD_INIT_DOWN, NOUVEAU_CARD_INIT_DONE, NOUVEAU_CARD_INIT_FAILED } init_state; /* the card type, takes NV_* as values */ enum nouveau_card_type card_type; /* exact chipset, derived from NV_PMC_BOOT_0 */ int chipset; int flags; void __iomem *mmio; void __iomem *ramin; uint32_t ramin_size; struct nouveau_bo *vga_ram; struct workqueue_struct *wq; struct work_struct irq_work; struct list_head vbl_waiting; struct { struct ttm_global_reference mem_global_ref; struct ttm_bo_global_ref bo_global_ref; struct ttm_bo_device bdev; spinlock_t bo_list_lock; struct list_head bo_list; atomic_t validate_sequence; } ttm; struct fb_info *fbdev_info; int fifo_alloc_count; struct nouveau_channel *fifos[NOUVEAU_MAX_CHANNEL_NR]; struct nouveau_engine engine; struct nouveau_channel *channel; /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */ struct nouveau_gpuobj *ramht; uint32_t ramin_rsvd_vram; uint32_t ramht_offset; uint32_t ramht_size; uint32_t ramht_bits; uint32_t ramfc_offset; uint32_t ramfc_size; uint32_t ramro_offset; uint32_t ramro_size; /* base physical adresses */ uint64_t fb_phys; uint64_t fb_available_size; uint64_t fb_mappable_pages; uint64_t fb_aper_free; struct { enum { NOUVEAU_GART_NONE = 0, NOUVEAU_GART_AGP, NOUVEAU_GART_SGDMA } type; uint64_t aper_base; uint64_t aper_size; uint64_t aper_free; struct nouveau_gpuobj *sg_ctxdma; struct page *sg_dummy_page; dma_addr_t sg_dummy_bus; /* nottm hack */ struct drm_ttm_backend *sg_be; unsigned long sg_handle; } gart_info; /* nv10-nv40 tiling regions */ struct { struct nouveau_tile_reg reg[NOUVEAU_MAX_TILE_NR]; spinlock_t lock; } tile; /* G8x/G9x virtual address space */ uint64_t vm_gart_base; uint64_t vm_gart_size; uint64_t vm_vram_base; uint64_t vm_vram_size; uint64_t vm_end; struct nouveau_gpuobj *vm_vram_pt[NV50_VM_VRAM_NR]; int vm_vram_pt_nr; /* the mtrr covering the FB */ int fb_mtrr; struct mem_block *ramin_heap; /* context table pointed to be NV_PGRAPH_CHANNEL_CTX_TABLE (0x400780) */ uint32_t ctx_table_size; struct nouveau_gpuobj_ref *ctx_table; struct list_head gpuobj_list; struct nvbios VBIOS; struct nouveau_bios_info *vbios; struct nv04_mode_state mode_reg; struct nv04_mode_state saved_reg; uint32_t saved_vga_font[4][16384]; uint32_t crtc_owner; uint32_t dac_users[4]; struct nouveau_suspend_resume { uint32_t fifo_mode; uint32_t graph_ctx_control; uint32_t graph_state; uint32_t *ramin_copy; uint64_t ramin_size; } susres; struct backlight_device *backlight; bool acpi_dsm; struct nouveau_channel *evo; struct { struct dentry *channel_root; } debugfs; }; static inline struct drm_nouveau_private * nouveau_bdev(struct ttm_bo_device *bd) { return container_of(bd, struct drm_nouveau_private, ttm.bdev); } static inline int nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo) { struct nouveau_bo *prev; if (!pnvbo) return -EINVAL; prev = *pnvbo; *pnvbo = ref ? nouveau_bo(ttm_bo_reference(&ref->bo)) : NULL; if (prev) { struct ttm_buffer_object *bo = &prev->bo; ttm_bo_unref(&bo); } return 0; } #define NOUVEAU_CHECK_INITIALISED_WITH_RETURN do { \ struct drm_nouveau_private *nv = dev->dev_private; \ if (nv->init_state != NOUVEAU_CARD_INIT_DONE) { \ NV_ERROR(dev, "called without init\n"); \ return -EINVAL; \ } \ } while (0) #define NOUVEAU_GET_USER_CHANNEL_WITH_RETURN(id, cl, ch) do { \ struct drm_nouveau_private *nv = dev->dev_private; \ if (!nouveau_channel_owner(dev, (cl), (id))) { \ NV_ERROR(dev, "pid %d doesn't own channel %d\n", \ DRM_CURRENTPID, (id)); \ return -EPERM; \ } \ (ch) = nv->fifos[(id)]; \ } while (0) /* nouveau_drv.c */ extern int nouveau_noagp; extern int nouveau_duallink; extern int nouveau_uscript_lvds; extern int nouveau_uscript_tmds; extern int nouveau_vram_pushbuf; extern int nouveau_vram_notify; extern int nouveau_fbpercrtc; extern char *nouveau_tv_norm; extern int nouveau_reg_debug; extern char *nouveau_vbios; extern int nouveau_ctxfw; extern int nouveau_ignorelid; extern int nouveau_nofbaccel; extern int nouveau_noaccel; /* nouveau_state.c */ extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern int nouveau_load(struct drm_device *, unsigned long flags); extern int nouveau_firstopen(struct drm_device *); extern void nouveau_lastclose(struct drm_device *); extern int nouveau_unload(struct drm_device *); extern int nouveau_ioctl_getparam(struct drm_device *, void *data, struct drm_file *); extern int nouveau_ioctl_setparam(struct drm_device *, void *data, struct drm_file *); extern bool nouveau_wait_until(struct drm_device *, uint64_t timeout, uint32_t reg, uint32_t mask, uint32_t val); extern bool nouveau_wait_for_idle(struct drm_device *); extern int nouveau_card_init(struct drm_device *); extern int nouveau_ioctl_card_init(struct drm_device *, void *data, struct drm_file *); extern int nouveau_ioctl_suspend(struct drm_device *, void *data, struct drm_file *); extern int nouveau_ioctl_resume(struct drm_device *, void *data, struct drm_file *); /* nouveau_mem.c */ extern int nouveau_mem_init_heap(struct mem_block **, uint64_t start, uint64_t size); extern struct mem_block *nouveau_mem_alloc_block(struct mem_block *, uint64_t size, int align2, struct drm_file *, int tail); extern void nouveau_mem_takedown(struct mem_block **heap); extern void nouveau_mem_free_block(struct mem_block *); extern uint64_t nouveau_mem_fb_amount(struct drm_device *); extern void nouveau_mem_release(struct drm_file *, struct mem_block *heap); extern int nouveau_mem_init(struct drm_device *); extern int nouveau_mem_init_agp(struct drm_device *); extern void nouveau_mem_close(struct drm_device *); extern struct nouveau_tile_reg *nv10_mem_set_tiling(struct drm_device *dev, uint32_t addr, uint32_t size, uint32_t pitch); extern void nv10_mem_expire_tiling(struct drm_device *dev, struct nouveau_tile_reg *tile, struct nouveau_fence *fence); extern int nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt, uint32_t size, uint32_t flags, uint64_t phys); extern void nv50_mem_vm_unbind(struct drm_device *, uint64_t virt, uint32_t size); /* nouveau_notifier.c */ extern int nouveau_notifier_init_channel(struct nouveau_channel *); extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, int cout, uint32_t *offset); extern int nouveau_notifier_offset(struct nouveau_gpuobj *, uint32_t *); extern int nouveau_ioctl_notifier_alloc(struct drm_device *, void *data, struct drm_file *); extern int nouveau_ioctl_notifier_free(struct drm_device *, void *data, struct drm_file *); /* nouveau_channel.c */ extern struct drm_ioctl_desc nouveau_ioctls[]; extern int nouveau_max_ioctl; extern void nouveau_channel_cleanup(struct drm_device *, struct drm_file *); extern int nouveau_channel_owner(struct drm_device *, struct drm_file *, int channel); extern int nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan, struct drm_file *file_priv, uint32_t fb_ctxdma, uint32_t tt_ctxdma); extern void nouveau_channel_free(struct nouveau_channel *); /* nouveau_object.c */ extern int nouveau_gpuobj_early_init(struct drm_device *); extern int nouveau_gpuobj_init(struct drm_device *); extern void nouveau_gpuobj_takedown(struct drm_device *); extern void nouveau_gpuobj_late_takedown(struct drm_device *); extern int nouveau_gpuobj_suspend(struct drm_device *dev); extern void nouveau_gpuobj_suspend_cleanup(struct drm_device *dev); extern void nouveau_gpuobj_resume(struct drm_device *dev); extern int nouveau_gpuobj_channel_init(struct nouveau_channel *, uint32_t vram_h, uint32_t tt_h); extern void nouveau_gpuobj_channel_takedown(struct nouveau_channel *); extern int nouveau_gpuobj_new(struct drm_device *, struct nouveau_channel *, uint32_t size, int align, uint32_t flags, struct nouveau_gpuobj **); extern int nouveau_gpuobj_del(struct drm_device *, struct nouveau_gpuobj **); extern int nouveau_gpuobj_ref_add(struct drm_device *, struct nouveau_channel *, uint32_t handle, struct nouveau_gpuobj *, struct nouveau_gpuobj_ref **); extern int nouveau_gpuobj_ref_del(struct drm_device *, struct nouveau_gpuobj_ref **); extern int nouveau_gpuobj_ref_find(struct nouveau_channel *, uint32_t handle, struct nouveau_gpuobj_ref **ref_ret); extern int nouveau_gpuobj_new_ref(struct drm_device *, struct nouveau_channel *alloc_chan, struct nouveau_channel *ref_chan, uint32_t handle, uint32_t size, int align, uint32_t flags, struct nouveau_gpuobj_ref **); extern int nouveau_gpuobj_new_fake(struct drm_device *, uint32_t p_offset, uint32_t b_offset, uint32_t size, uint32_t flags, struct nouveau_gpuobj **, struct nouveau_gpuobj_ref**); extern int nouveau_gpuobj_dma_new(struct nouveau_channel *, int class, uint64_t offset, uint64_t size, int access, int target, struct nouveau_gpuobj **); extern int nouveau_gpuobj_gart_dma_new(struct nouveau_channel *, uint64_t offset, uint64_t size, int access, struct nouveau_gpuobj **, uint32_t *o_ret); extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class, struct nouveau_gpuobj **); extern int nouveau_gpuobj_sw_new(struct nouveau_channel *, int class, struct nouveau_gpuobj **); extern int nouveau_ioctl_grobj_alloc(struct drm_device *, void *data, struct drm_file *); extern int nouveau_ioctl_gpuobj_free(struct drm_device *, void *data, struct drm_file *); /* nouveau_irq.c */ extern irqreturn_t nouveau_irq_handler(DRM_IRQ_ARGS); extern void nouveau_irq_preinstall(struct drm_device *); extern int nouveau_irq_postinstall(struct drm_device *); extern void nouveau_irq_uninstall(struct drm_device *); /* nouveau_sgdma.c */ extern int nouveau_sgdma_init(struct drm_device *); extern void nouveau_sgdma_takedown(struct drm_device *); extern int nouveau_sgdma_get_page(struct drm_device *, uint32_t offset, uint32_t *page); extern struct ttm_backend *nouveau_sgdma_init_ttm(struct drm_device *); /* nouveau_debugfs.c */ #if defined(CONFIG_DRM_NOUVEAU_DEBUG) extern int nouveau_debugfs_init(struct drm_minor *); extern void nouveau_debugfs_takedown(struct drm_minor *); extern int nouveau_debugfs_channel_init(struct nouveau_channel *); extern void nouveau_debugfs_channel_fini(struct nouveau_channel *); #else static inline int nouveau_debugfs_init(struct drm_minor *minor) { return 0; } static inline void nouveau_debugfs_takedown(struct drm_minor *minor) { } static inline int nouveau_debugfs_channel_init(struct nouveau_channel *chan) { return 0; } static inline void nouveau_debugfs_channel_fini(struct nouveau_channel *chan) { } #endif /* nouveau_dma.c */ extern void nouveau_dma_pre_init(struct nouveau_channel *); extern int nouveau_dma_init(struct nouveau_channel *); extern int nouveau_dma_wait(struct nouveau_channel *, int size); /* nouveau_acpi.c */ #ifdef CONFIG_ACPI extern int nouveau_hybrid_setup(struct drm_device *dev); extern bool nouveau_dsm_probe(struct drm_device *dev); #else static inline int nouveau_hybrid_setup(struct drm_device *dev) { return 0; } static inline bool nouveau_dsm_probe(struct drm_device *dev) { return false; } #endif /* nouveau_backlight.c */ #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT extern int nouveau_backlight_init(struct drm_device *); extern void nouveau_backlight_exit(struct drm_device *); #else static inline int nouveau_backlight_init(struct drm_device *dev) { return 0; } static inline void nouveau_backlight_exit(struct drm_device *dev) { } #endif /* nouveau_bios.c */ extern int nouveau_bios_init(struct drm_device *); extern void nouveau_bios_takedown(struct drm_device *dev); extern int nouveau_run_vbios_init(struct drm_device *); extern void nouveau_bios_run_init_table(struct drm_device *, uint16_t table, struct dcb_entry *); extern struct dcb_gpio_entry *nouveau_bios_gpio_entry(struct drm_device *, enum dcb_gpio_tag); extern struct dcb_connector_table_entry * nouveau_bios_connector_entry(struct drm_device *, int index); extern int get_pll_limits(struct drm_device *, uint32_t limit_match, struct pll_lims *); extern int nouveau_bios_run_display_table(struct drm_device *, struct dcb_entry *, uint32_t script, int pxclk); extern void *nouveau_bios_dp_table(struct drm_device *, struct dcb_entry *, int *length); extern bool nouveau_bios_fp_mode(struct drm_device *, struct drm_display_mode *); extern uint8_t *nouveau_bios_embedded_edid(struct drm_device *); extern int nouveau_bios_parse_lvds_table(struct drm_device *, int pxclk, bool *dl, bool *if_is_24bit); extern int run_tmds_table(struct drm_device *, struct dcb_entry *, int head, int pxclk); extern int call_lvds_script(struct drm_device *, struct dcb_entry *, int head, enum LVDS_script, int pxclk); /* nouveau_ttm.c */ int nouveau_ttm_global_init(struct drm_nouveau_private *); void nouveau_ttm_global_release(struct drm_nouveau_private *); int nouveau_ttm_mmap(struct file *, struct vm_area_struct *); /* nouveau_dp.c */ int nouveau_dp_auxch(struct nouveau_i2c_chan *auxch, int cmd, int addr, uint8_t *data, int data_nr); bool nouveau_dp_detect(struct drm_encoder *); bool nouveau_dp_link_train(struct drm_encoder *); /* nv04_fb.c */ extern int nv04_fb_init(struct drm_device *); extern void nv04_fb_takedown(struct drm_device *); /* nv10_fb.c */ extern int nv10_fb_init(struct drm_device *); extern void nv10_fb_takedown(struct drm_device *); extern void nv10_fb_set_region_tiling(struct drm_device *, int, uint32_t, uint32_t, uint32_t); /* nv40_fb.c */ extern int nv40_fb_init(struct drm_device *); extern void nv40_fb_takedown(struct drm_device *); extern void nv40_fb_set_region_tiling(struct drm_device *, int, uint32_t, uint32_t, uint32_t); /* nv04_fifo.c */ extern int nv04_fifo_init(struct drm_device *); extern void nv04_fifo_disable(struct drm_device *); extern void nv04_fifo_enable(struct drm_device *); extern bool nv04_fifo_reassign(struct drm_device *, bool); extern bool nv04_fifo_cache_flush(struct drm_device *); extern bool nv04_fifo_cache_pull(struct drm_device *, bool); extern int nv04_fifo_channel_id(struct drm_device *); extern int nv04_fifo_create_context(struct nouveau_channel *); extern void nv04_fifo_destroy_context(struct nouveau_channel *); extern int nv04_fifo_load_context(struct nouveau_channel *); extern int nv04_fifo_unload_context(struct drm_device *); /* nv10_fifo.c */ extern int nv10_fifo_init(struct drm_device *); extern int nv10_fifo_channel_id(struct drm_device *); extern int nv10_fifo_create_context(struct nouveau_channel *); extern void nv10_fifo_destroy_context(struct nouveau_channel *); extern int nv10_fifo_load_context(struct nouveau_channel *); extern int nv10_fifo_unload_context(struct drm_device *); /* nv40_fifo.c */ extern int nv40_fifo_init(struct drm_device *); extern int nv40_fifo_create_context(struct nouveau_channel *); extern void nv40_fifo_destroy_context(struct nouveau_channel *); extern int nv40_fifo_load_context(struct nouveau_channel *); extern int nv40_fifo_unload_context(struct drm_device *); /* nv50_fifo.c */ extern int nv50_fifo_init(struct drm_device *); extern void nv50_fifo_takedown(struct drm_device *); extern int nv50_fifo_channel_id(struct drm_device *); extern int nv50_fifo_create_context(struct nouveau_channel *); extern void nv50_fifo_destroy_context(struct nouveau_channel *); extern int nv50_fifo_load_context(struct nouveau_channel *); extern int nv50_fifo_unload_context(struct drm_device *); /* nv04_graph.c */ extern struct nouveau_pgraph_object_class nv04_graph_grclass[]; extern int nv04_graph_init(struct drm_device *); extern void nv04_graph_takedown(struct drm_device *); extern void nv04_graph_fifo_access(struct drm_device *, bool); extern struct nouveau_channel *nv04_graph_channel(struct drm_device *); extern int nv04_graph_create_context(struct nouveau_channel *); extern void nv04_graph_destroy_context(struct nouveau_channel *); extern int nv04_graph_load_context(struct nouveau_channel *); extern int nv04_graph_unload_context(struct drm_device *); extern void nv04_graph_context_switch(struct drm_device *); /* nv10_graph.c */ extern struct nouveau_pgraph_object_class nv10_graph_grclass[]; extern int nv10_graph_init(struct drm_device *); extern void nv10_graph_takedown(struct drm_device *); extern struct nouveau_channel *nv10_graph_channel(struct drm_device *); extern int nv10_graph_create_context(struct nouveau_channel *); extern void nv10_graph_destroy_context(struct nouveau_channel *); extern int nv10_graph_load_context(struct nouveau_channel *); extern int nv10_graph_unload_context(struct drm_device *); extern void nv10_graph_context_switch(struct drm_device *); extern void nv10_graph_set_region_tiling(struct drm_device *, int, uint32_t, uint32_t, uint32_t); /* nv20_graph.c */ extern struct nouveau_pgraph_object_class nv20_graph_grclass[]; extern struct nouveau_pgraph_object_class nv30_graph_grclass[]; extern int nv20_graph_create_context(struct nouveau_channel *); extern void nv20_graph_destroy_context(struct nouveau_channel *); extern int nv20_graph_load_context(struct nouveau_channel *); extern int nv20_graph_unload_context(struct drm_device *); extern int nv20_graph_init(struct drm_device *); extern void nv20_graph_takedown(struct drm_device *); extern int nv30_graph_init(struct drm_device *); extern void nv20_graph_set_region_tiling(struct drm_device *, int, uint32_t, uint32_t, uint32_t); /* nv40_graph.c */ extern struct nouveau_pgraph_object_class nv40_graph_grclass[]; extern int nv40_graph_init(struct drm_device *); extern void nv40_graph_takedown(struct drm_device *); extern struct nouveau_channel *nv40_graph_channel(struct drm_device *); extern int nv40_graph_create_context(struct nouveau_channel *); extern void nv40_graph_destroy_context(struct nouveau_channel *); extern int nv40_graph_load_context(struct nouveau_channel *); extern int nv40_graph_unload_context(struct drm_device *); extern void nv40_grctx_init(struct nouveau_grctx *); extern void nv40_graph_set_region_tiling(struct drm_device *, int, uint32_t, uint32_t, uint32_t); /* nv50_graph.c */ extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; extern int nv50_graph_init(struct drm_device *); extern void nv50_graph_takedown(struct drm_device *); extern void nv50_graph_fifo_access(struct drm_device *, bool); extern struct nouveau_channel *nv50_graph_channel(struct drm_device *); extern int nv50_graph_create_context(struct nouveau_channel *); extern void nv50_graph_destroy_context(struct nouveau_channel *); extern int nv50_graph_load_context(struct nouveau_channel *); extern int nv50_graph_unload_context(struct drm_device *); extern void nv50_graph_context_switch(struct drm_device *); /* nouveau_grctx.c */ extern int nouveau_grctx_prog_load(struct drm_device *); extern void nouveau_grctx_vals_load(struct drm_device *, struct nouveau_gpuobj *); extern void nouveau_grctx_fini(struct drm_device *); /* nv04_instmem.c */ extern int nv04_instmem_init(struct drm_device *); extern void nv04_instmem_takedown(struct drm_device *); extern int nv04_instmem_suspend(struct drm_device *); extern void nv04_instmem_resume(struct drm_device *); extern int nv04_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, uint32_t *size); extern void nv04_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); extern int nv04_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); extern int nv04_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); extern void nv04_instmem_prepare_access(struct drm_device *, bool write); extern void nv04_instmem_finish_access(struct drm_device *); /* nv50_instmem.c */ extern int nv50_instmem_init(struct drm_device *); extern void nv50_instmem_takedown(struct drm_device *); extern int nv50_instmem_suspend(struct drm_device *); extern void nv50_instmem_resume(struct drm_device *); extern int nv50_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, uint32_t *size); extern void nv50_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); extern int nv50_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); extern int nv50_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); extern void nv50_instmem_prepare_access(struct drm_device *, bool write); extern void nv50_instmem_finish_access(struct drm_device *); /* nv04_mc.c */ extern int nv04_mc_init(struct drm_device *); extern void nv04_mc_takedown(struct drm_device *); /* nv40_mc.c */ extern int nv40_mc_init(struct drm_device *); extern void nv40_mc_takedown(struct drm_device *); /* nv50_mc.c */ extern int nv50_mc_init(struct drm_device *); extern void nv50_mc_takedown(struct drm_device *); /* nv04_timer.c */ extern int nv04_timer_init(struct drm_device *); extern uint64_t nv04_timer_read(struct drm_device *); extern void nv04_timer_takedown(struct drm_device *); extern long nouveau_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg); /* nv04_dac.c */ extern int nv04_dac_create(struct drm_device *dev, struct dcb_entry *entry); extern uint32_t nv17_dac_sample_load(struct drm_encoder *encoder); extern int nv04_dac_output_offset(struct drm_encoder *encoder); extern void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable); /* nv04_dfp.c */ extern int nv04_dfp_create(struct drm_device *dev, struct dcb_entry *entry); extern int nv04_dfp_get_bound_head(struct drm_device *dev, struct dcb_entry *dcbent); extern void nv04_dfp_bind_head(struct drm_device *dev, struct dcb_entry *dcbent, int head, bool dl); extern void nv04_dfp_disable(struct drm_device *dev, int head); extern void nv04_dfp_update_fp_control(struct drm_encoder *encoder, int mode); /* nv04_tv.c */ extern int nv04_tv_identify(struct drm_device *dev, int i2c_index); extern int nv04_tv_create(struct drm_device *dev, struct dcb_entry *entry); /* nv17_tv.c */ extern int nv17_tv_create(struct drm_device *dev, struct dcb_entry *entry); /* nv04_display.c */ extern int nv04_display_create(struct drm_device *); extern void nv04_display_destroy(struct drm_device *); extern void nv04_display_restore(struct drm_device *); /* nv04_crtc.c */ extern int nv04_crtc_create(struct drm_device *, int index); /* nouveau_bo.c */ extern struct ttm_bo_driver nouveau_bo_driver; extern int nouveau_bo_new(struct drm_device *, struct nouveau_channel *, int size, int align, uint32_t flags, uint32_t tile_mode, uint32_t tile_flags, bool no_vm, bool mappable, struct nouveau_bo **); extern int nouveau_bo_pin(struct nouveau_bo *, uint32_t flags); extern int nouveau_bo_unpin(struct nouveau_bo *); extern int nouveau_bo_map(struct nouveau_bo *); extern void nouveau_bo_unmap(struct nouveau_bo *); extern void nouveau_bo_placement_set(struct nouveau_bo *, uint32_t memtype); extern u16 nouveau_bo_rd16(struct nouveau_bo *nvbo, unsigned index); extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val); extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index); extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val); /* nouveau_fence.c */ struct nouveau_fence; extern int nouveau_fence_init(struct nouveau_channel *); extern void nouveau_fence_fini(struct nouveau_channel *); extern void nouveau_fence_update(struct nouveau_channel *); extern int nouveau_fence_new(struct nouveau_channel *, struct nouveau_fence **, bool emit); extern int nouveau_fence_emit(struct nouveau_fence *); struct nouveau_channel *nouveau_fence_channel(struct nouveau_fence *); extern bool nouveau_fence_signalled(void *obj, void *arg); extern int nouveau_fence_wait(void *obj, void *arg, bool lazy, bool intr); extern int nouveau_fence_flush(void *obj, void *arg); extern void nouveau_fence_unref(void **obj); extern void *nouveau_fence_ref(void *obj); extern void nouveau_fence_handler(struct drm_device *dev, int channel); /* nouveau_gem.c */ extern int nouveau_gem_new(struct drm_device *, struct nouveau_channel *, int size, int align, uint32_t flags, uint32_t tile_mode, uint32_t tile_flags, bool no_vm, bool mappable, struct nouveau_bo **); extern int nouveau_gem_object_new(struct drm_gem_object *); extern void nouveau_gem_object_del(struct drm_gem_object *); extern int nouveau_gem_ioctl_new(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_pushbuf_call(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_pushbuf_call2(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_pin(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_unpin(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_tile(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_ioctl_info(struct drm_device *, void *, struct drm_file *); /* nv17_gpio.c */ int nv17_gpio_get(struct drm_device *dev, enum dcb_gpio_tag tag); int nv17_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state); #ifndef ioread32_native #ifdef __BIG_ENDIAN #define ioread16_native ioread16be #define iowrite16_native iowrite16be #define ioread32_native ioread32be #define iowrite32_native iowrite32be #else /* def __BIG_ENDIAN */ #define ioread16_native ioread16 #define iowrite16_native iowrite16 #define ioread32_native ioread32 #define iowrite32_native iowrite32 #endif /* def __BIG_ENDIAN else */ #endif /* !ioread32_native */ /* channel control reg access */ static inline u32 nvchan_rd32(struct nouveau_channel *chan, unsigned reg) { return ioread32_native(chan->user + reg); } static inline void nvchan_wr32(struct nouveau_channel *chan, unsigned reg, u32 val) { iowrite32_native(val, chan->user + reg); } /* register access */ static inline u32 nv_rd32(struct drm_device *dev, unsigned reg) { struct drm_nouveau_private *dev_priv = dev->dev_private; return ioread32_native(dev_priv->mmio + reg); } static inline void nv_wr32(struct drm_device *dev, unsigned reg, u32 val) { struct drm_nouveau_private *dev_priv = dev->dev_private; iowrite32_native(val, dev_priv->mmio + reg); } static inline u8 nv_rd08(struct drm_device *dev, unsigned reg) { struct drm_nouveau_private *dev_priv = dev->dev_private; return ioread8(dev_priv->mmio + reg); } static inline void nv_wr08(struct drm_device *dev, unsigned reg, u8 val) { struct drm_nouveau_private *dev_priv = dev->dev_private; iowrite8(val, dev_priv->mmio + reg); } #define nv_wait(reg, mask, val) \ nouveau_wait_until(dev, 2000000000ULL, (reg), (mask), (val)) /* PRAMIN access */ static inline u32 nv_ri32(struct drm_device *dev, unsigned offset) { struct drm_nouveau_private *dev_priv = dev->dev_private; return ioread32_native(dev_priv->ramin + offset); } static inline void nv_wi32(struct drm_device *dev, unsigned offset, u32 val) { struct drm_nouveau_private *dev_priv = dev->dev_private; iowrite32_native(val, dev_priv->ramin + offset); } /* object access */ static inline u32 nv_ro32(struct drm_device *dev, struct nouveau_gpuobj *obj, unsigned index) { return nv_ri32(dev, obj->im_pramin->start + index * 4); } static inline void nv_wo32(struct drm_device *dev, struct nouveau_gpuobj *obj, unsigned index, u32 val) { nv_wi32(dev, obj->im_pramin->start + index * 4, val); } /* * Logging * Argument d is (struct drm_device *). */ #define NV_PRINTK(level, d, fmt, arg...) \ printk(level "[" DRM_NAME "] " DRIVER_NAME " %s: " fmt, \ pci_name(d->pdev), ##arg) #ifndef NV_DEBUG_NOTRACE #define NV_DEBUG(d, fmt, arg...) do { \ if (drm_debug & DRM_UT_DRIVER) { \ NV_PRINTK(KERN_DEBUG, d, "%s:%d - " fmt, __func__, \ __LINE__, ##arg); \ } \ } while (0) #define NV_DEBUG_KMS(d, fmt, arg...) do { \ if (drm_debug & DRM_UT_KMS) { \ NV_PRINTK(KERN_DEBUG, d, "%s:%d - " fmt, __func__, \ __LINE__, ##arg); \ } \ } while (0) #else #define NV_DEBUG(d, fmt, arg...) do { \ if (drm_debug & DRM_UT_DRIVER) \ NV_PRINTK(KERN_DEBUG, d, fmt, ##arg); \ } while (0) #define NV_DEBUG_KMS(d, fmt, arg...) do { \ if (drm_debug & DRM_UT_KMS) \ NV_PRINTK(KERN_DEBUG, d, fmt, ##arg); \ } while (0) #endif #define NV_ERROR(d, fmt, arg...) NV_PRINTK(KERN_ERR, d, fmt, ##arg) #define NV_INFO(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg) #define NV_TRACEWARN(d, fmt, arg...) NV_PRINTK(KERN_NOTICE, d, fmt, ##arg) #define NV_TRACE(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg) #define NV_WARN(d, fmt, arg...) NV_PRINTK(KERN_WARNING, d, fmt, ##arg) /* nouveau_reg_debug bitmask */ enum { NOUVEAU_REG_DEBUG_MC = 0x1, NOUVEAU_REG_DEBUG_VIDEO = 0x2, NOUVEAU_REG_DEBUG_FB = 0x4, NOUVEAU_REG_DEBUG_EXTDEV = 0x8, NOUVEAU_REG_DEBUG_CRTC = 0x10, NOUVEAU_REG_DEBUG_RAMDAC = 0x20, NOUVEAU_REG_DEBUG_VGACRTC = 0x40, NOUVEAU_REG_DEBUG_RMVIO = 0x80, NOUVEAU_REG_DEBUG_VGAATTR = 0x100, NOUVEAU_REG_DEBUG_EVO = 0x200, }; #define NV_REG_DEBUG(type, dev, fmt, arg...) do { \ if (nouveau_reg_debug & NOUVEAU_REG_DEBUG_##type) \ NV_PRINTK(KERN_DEBUG, dev, "%s: " fmt, __func__, ##arg); \ } while (0) static inline bool nv_two_heads(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; const int impl = dev->pci_device & 0x0ff0; if (dev_priv->card_type >= NV_10 && impl != 0x0100 && impl != 0x0150 && impl != 0x01a0 && impl != 0x0200) return true; return false; } static inline bool nv_gf4_disp_arch(struct drm_device *dev) { return nv_two_heads(dev) && (dev->pci_device & 0x0ff0) != 0x0110; } static inline bool nv_two_reg_pll(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; const int impl = dev->pci_device & 0x0ff0; if (impl == 0x0310 || impl == 0x0340 || dev_priv->card_type >= NV_40) return true; return false; } #define NV_SW 0x0000506e #define NV_SW_DMA_SEMAPHORE 0x00000060 #define NV_SW_SEMAPHORE_OFFSET 0x00000064 #define NV_SW_SEMAPHORE_ACQUIRE 0x00000068 #define NV_SW_SEMAPHORE_RELEASE 0x0000006c #define NV_SW_DMA_VBLSEM 0x0000018c #define NV_SW_VBLSEM_OFFSET 0x00000400 #define NV_SW_VBLSEM_RELEASE_VALUE 0x00000404 #define NV_SW_VBLSEM_RELEASE 0x00000408 #endif /* __NOUVEAU_DRV_H__ */