1
0

fblogo.patch 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097
  1. diff -Nur linux-3.13.7.orig/Documentation/fb/00-INDEX linux-3.13.7/Documentation/fb/00-INDEX
  2. --- linux-3.13.7.orig/Documentation/fb/00-INDEX 2014-03-24 05:45:42.000000000 +0100
  3. +++ linux-3.13.7/Documentation/fb/00-INDEX 2014-03-29 16:03:17.000000000 +0100
  4. @@ -21,6 +21,8 @@
  5. - info on the driver for EP93xx LCD controller.
  6. fbcon.txt
  7. - intro to and usage guide for the framebuffer console (fbcon).
  8. +fbcondecor.txt
  9. + - info on the Framebuffer Console Decoration
  10. framebuffer.txt
  11. - introduction to frame buffer devices.
  12. gxfb.txt
  13. diff -Nur linux-3.13.7.orig/Documentation/fb/fbcondecor.txt linux-3.13.7/Documentation/fb/fbcondecor.txt
  14. --- linux-3.13.7.orig/Documentation/fb/fbcondecor.txt 1970-01-01 01:00:00.000000000 +0100
  15. +++ linux-3.13.7/Documentation/fb/fbcondecor.txt 2014-03-29 16:03:17.000000000 +0100
  16. @@ -0,0 +1,207 @@
  17. +What is it?
  18. +-----------
  19. +
  20. +The framebuffer decorations are a kernel feature which allows displaying a
  21. +background picture on selected consoles.
  22. +
  23. +What do I need to get it to work?
  24. +---------------------------------
  25. +
  26. +To get fbcondecor up-and-running you will have to:
  27. + 1) get a copy of splashutils [1] or a similar program
  28. + 2) get some fbcondecor themes
  29. + 3) build the kernel helper program
  30. + 4) build your kernel with the FB_CON_DECOR option enabled.
  31. +
  32. +To get fbcondecor operational right after fbcon initialization is finished, you
  33. +will have to include a theme and the kernel helper into your initramfs image.
  34. +Please refer to splashutils documentation for instructions on how to do that.
  35. +
  36. +[1] The splashutils package can be downloaded from:
  37. + http://github.com/alanhaggai/fbsplash
  38. +
  39. +The userspace helper
  40. +--------------------
  41. +
  42. +The userspace fbcondecor helper (by default: /sbin/fbcondecor_helper) is called by the
  43. +kernel whenever an important event occurs and the kernel needs some kind of
  44. +job to be carried out. Important events include console switches and video
  45. +mode switches (the kernel requests background images and configuration
  46. +parameters for the current console). The fbcondecor helper must be accessible at
  47. +all times. If it's not, fbcondecor will be switched off automatically.
  48. +
  49. +It's possible to set path to the fbcondecor helper by writing it to
  50. +/proc/sys/kernel/fbcondecor.
  51. +
  52. +*****************************************************************************
  53. +
  54. +The information below is mostly technical stuff. There's probably no need to
  55. +read it unless you plan to develop a userspace helper.
  56. +
  57. +The fbcondecor protocol
  58. +-----------------------
  59. +
  60. +The fbcondecor protocol defines a communication interface between the kernel and
  61. +the userspace fbcondecor helper.
  62. +
  63. +The kernel side is responsible for:
  64. +
  65. + * rendering console text, using an image as a background (instead of a
  66. + standard solid color fbcon uses),
  67. + * accepting commands from the user via ioctls on the fbcondecor device,
  68. + * calling the userspace helper to set things up as soon as the fb subsystem
  69. + is initialized.
  70. +
  71. +The userspace helper is responsible for everything else, including parsing
  72. +configuration files, decompressing the image files whenever the kernel needs
  73. +it, and communicating with the kernel if necessary.
  74. +
  75. +The fbcondecor protocol specifies how communication is done in both ways:
  76. +kernel->userspace and userspace->helper.
  77. +
  78. +Kernel -> Userspace
  79. +-------------------
  80. +
  81. +The kernel communicates with the userspace helper by calling it and specifying
  82. +the task to be done in a series of arguments.
  83. +
  84. +The arguments follow the pattern:
  85. +<fbcondecor protocol version> <command> <parameters>
  86. +
  87. +All commands defined in fbcondecor protocol v2 have the following parameters:
  88. + virtual console
  89. + framebuffer number
  90. + theme
  91. +
  92. +Fbcondecor protocol v1 specified an additional 'fbcondecor mode' after the
  93. +framebuffer number. Fbcondecor protocol v1 is deprecated and should not be used.
  94. +
  95. +Fbcondecor protocol v2 specifies the following commands:
  96. +
  97. +getpic
  98. +------
  99. + The kernel issues this command to request image data. It's up to the
  100. + userspace helper to find a background image appropriate for the specified
  101. + theme and the current resolution. The userspace helper should respond by
  102. + issuing the FBIOCONDECOR_SETPIC ioctl.
  103. +
  104. +init
  105. +----
  106. + The kernel issues this command after the fbcondecor device is created and
  107. + the fbcondecor interface is initialized. Upon receiving 'init', the userspace
  108. + helper should parse the kernel command line (/proc/cmdline) or otherwise
  109. + decide whether fbcondecor is to be activated.
  110. +
  111. + To activate fbcondecor on the first console the helper should issue the
  112. + FBIOCONDECOR_SETCFG, FBIOCONDECOR_SETPIC and FBIOCONDECOR_SETSTATE commands,
  113. + in the above-mentioned order.
  114. +
  115. + When the userspace helper is called in an early phase of the boot process
  116. + (right after the initialization of fbcon), no filesystems will be mounted.
  117. + The helper program should mount sysfs and then create the appropriate
  118. + framebuffer, fbcondecor and tty0 devices (if they don't already exist) to get
  119. + current display settings and to be able to communicate with the kernel side.
  120. + It should probably also mount the procfs to be able to parse the kernel
  121. + command line parameters.
  122. +
  123. + Note that the console sem is not held when the kernel calls fbcondecor_helper
  124. + with the 'init' command. The fbcondecor helper should perform all ioctls with
  125. + origin set to FBCON_DECOR_IO_ORIG_USER.
  126. +
  127. +modechange
  128. +----------
  129. + The kernel issues this command on a mode change. The helper's response should
  130. + be similar to the response to the 'init' command. Note that this time the
  131. + console sem is held and all ioctls must be performed with origin set to
  132. + FBCON_DECOR_IO_ORIG_KERNEL.
  133. +
  134. +
  135. +Userspace -> Kernel
  136. +-------------------
  137. +
  138. +Userspace programs can communicate with fbcondecor via ioctls on the
  139. +fbcondecor device. These ioctls are to be used by both the userspace helper
  140. +(called only by the kernel) and userspace configuration tools (run by the users).
  141. +
  142. +The fbcondecor helper should set the origin field to FBCON_DECOR_IO_ORIG_KERNEL
  143. +when doing the appropriate ioctls. All userspace configuration tools should
  144. +use FBCON_DECOR_IO_ORIG_USER. Failure to set the appropriate value in the origin
  145. +field when performing ioctls from the kernel helper will most likely result
  146. +in a console deadlock.
  147. +
  148. +FBCON_DECOR_IO_ORIG_KERNEL instructs fbcondecor not to try to acquire the console
  149. +semaphore. Not surprisingly, FBCON_DECOR_IO_ORIG_USER instructs it to acquire
  150. +the console sem.
  151. +
  152. +The framebuffer console decoration provides the following ioctls (all defined in
  153. +linux/fb.h):
  154. +
  155. +FBIOCONDECOR_SETPIC
  156. +description: loads a background picture for a virtual console
  157. +argument: struct fbcon_decor_iowrapper*; data: struct fb_image*
  158. +notes:
  159. +If called for consoles other than the current foreground one, the picture data
  160. +will be ignored.
  161. +
  162. +If the current virtual console is running in a 8-bpp mode, the cmap substruct
  163. +of fb_image has to be filled appropriately: start should be set to 16 (first
  164. +16 colors are reserved for fbcon), len to a value <= 240 and red, green and
  165. +blue should point to valid cmap data. The transp field is ingored. The fields
  166. +dx, dy, bg_color, fg_color in fb_image are ignored as well.
  167. +
  168. +FBIOCONDECOR_SETCFG
  169. +description: sets the fbcondecor config for a virtual console
  170. +argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
  171. +notes: The structure has to be filled with valid data.
  172. +
  173. +FBIOCONDECOR_GETCFG
  174. +description: gets the fbcondecor config for a virtual console
  175. +argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
  176. +
  177. +FBIOCONDECOR_SETSTATE
  178. +description: sets the fbcondecor state for a virtual console
  179. +argument: struct fbcon_decor_iowrapper*; data: unsigned int*
  180. + values: 0 = disabled, 1 = enabled.
  181. +
  182. +FBIOCONDECOR_GETSTATE
  183. +description: gets the fbcondecor state for a virtual console
  184. +argument: struct fbcon_decor_iowrapper*; data: unsigned int*
  185. + values: as in FBIOCONDECOR_SETSTATE
  186. +
  187. +Info on used structures:
  188. +
  189. +Definition of struct vc_decor can be found in linux/console_decor.h. It's
  190. +heavily commented. Note that the 'theme' field should point to a string
  191. +no longer than FBCON_DECOR_THEME_LEN. When FBIOCONDECOR_GETCFG call is
  192. +performed, the theme field should point to a char buffer of length
  193. +FBCON_DECOR_THEME_LEN.
  194. +
  195. +Definition of struct fbcon_decor_iowrapper can be found in linux/fb.h.
  196. +The fields in this struct have the following meaning:
  197. +
  198. +vc:
  199. +Virtual console number.
  200. +
  201. +origin:
  202. +Specifies if the ioctl is performed as a response to a kernel request. The
  203. +fbcondecor helper should set this field to FBCON_DECOR_IO_ORIG_KERNEL, userspace
  204. +programs should set it to FBCON_DECOR_IO_ORIG_USER. This field is necessary to
  205. +avoid console semaphore deadlocks.
  206. +
  207. +data:
  208. +Pointer to a data structure appropriate for the performed ioctl. Type of
  209. +the data struct is specified in the ioctls description.
  210. +
  211. +*****************************************************************************
  212. +
  213. +Credit
  214. +------
  215. +
  216. +Original 'bootsplash' project & implementation by:
  217. + Volker Poplawski <volker@poplawski.de>, Stefan Reinauer <stepan@suse.de>,
  218. + Steffen Winterfeldt <snwint@suse.de>, Michael Schroeder <mls@suse.de>,
  219. + Ken Wimer <wimer@suse.de>.
  220. +
  221. +Fbcondecor, fbcondecor protocol design, current implementation & docs by:
  222. + Michal Januszewski <michalj+fbcondecor@gmail.com>
  223. +
  224. diff -Nur linux-3.13.7.orig/drivers/Makefile linux-3.13.7/drivers/Makefile
  225. --- linux-3.13.7.orig/drivers/Makefile 2014-03-24 05:45:42.000000000 +0100
  226. +++ linux-3.13.7/drivers/Makefile 2014-03-29 16:03:17.000000000 +0100
  227. @@ -17,6 +17,10 @@
  228. obj-$(CONFIG_PCI) += pci/
  229. obj-$(CONFIG_PARISC) += parisc/
  230. obj-$(CONFIG_RAPIDIO) += rapidio/
  231. +# tty/ comes before char/ so that the VT console is the boot-time
  232. +# default.
  233. +obj-y += tty/
  234. +obj-y += char/
  235. obj-y += video/
  236. obj-y += idle/
  237. @@ -42,11 +46,6 @@
  238. # reset controllers early, since gpu drivers might rely on them to initialize
  239. obj-$(CONFIG_RESET_CONTROLLER) += reset/
  240. -# tty/ comes before char/ so that the VT console is the boot-time
  241. -# default.
  242. -obj-y += tty/
  243. -obj-y += char/
  244. -
  245. # gpu/ comes after char for AGP vs DRM startup
  246. obj-y += gpu/
  247. diff -Nur linux-3.13.7.orig/drivers/video/Kconfig linux-3.13.7/drivers/video/Kconfig
  248. --- linux-3.13.7.orig/drivers/video/Kconfig 2014-03-24 05:45:42.000000000 +0100
  249. +++ linux-3.13.7/drivers/video/Kconfig 2014-03-29 16:03:17.000000000 +0100
  250. @@ -1231,7 +1231,6 @@
  251. select FB_CFB_FILLRECT
  252. select FB_CFB_COPYAREA
  253. select FB_CFB_IMAGEBLIT
  254. - select FB_TILEBLITTING
  255. select FB_MACMODES if PPC_PMAC
  256. ---help---
  257. Say Y here if you have a Matrox Millennium, Matrox Millennium II,
  258. diff -Nur linux-3.13.7.orig/drivers/video/console/Kconfig linux-3.13.7/drivers/video/console/Kconfig
  259. --- linux-3.13.7.orig/drivers/video/console/Kconfig 2014-03-24 05:45:42.000000000 +0100
  260. +++ linux-3.13.7/drivers/video/console/Kconfig 2014-03-29 16:03:17.000000000 +0100
  261. @@ -125,6 +125,19 @@
  262. such that other users of the framebuffer will remain normally
  263. oriented.
  264. +config FB_CON_DECOR
  265. + bool "Support for the Framebuffer Console Decorations"
  266. + depends on FRAMEBUFFER_CONSOLE=y && !FB_TILEBLITTING
  267. + default n
  268. + ---help---
  269. + This option enables support for framebuffer console decorations which
  270. + makes it possible to display images in the background of the system
  271. + consoles. Note that userspace utilities are necessary in order to take
  272. + advantage of these features. Refer to Documentation/fb/fbcondecor.txt
  273. + for more information.
  274. +
  275. + If unsure, say N.
  276. +
  277. config STI_CONSOLE
  278. bool "STI text console"
  279. depends on PARISC
  280. diff -Nur linux-3.13.7.orig/drivers/video/console/Makefile linux-3.13.7/drivers/video/console/Makefile
  281. --- linux-3.13.7.orig/drivers/video/console/Makefile 2014-03-24 05:45:42.000000000 +0100
  282. +++ linux-3.13.7/drivers/video/console/Makefile 2014-03-29 16:03:17.000000000 +0100
  283. @@ -16,4 +16,5 @@
  284. fbcon_ccw.o
  285. endif
  286. +obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o
  287. obj-$(CONFIG_FB_STI) += sticore.o
  288. diff -Nur linux-3.13.7.orig/drivers/video/console/bitblit.c linux-3.13.7/drivers/video/console/bitblit.c
  289. --- linux-3.13.7.orig/drivers/video/console/bitblit.c 2014-03-24 05:45:42.000000000 +0100
  290. +++ linux-3.13.7/drivers/video/console/bitblit.c 2014-03-29 16:03:17.000000000 +0100
  291. @@ -18,6 +18,7 @@
  292. #include <linux/console.h>
  293. #include <asm/types.h>
  294. #include "fbcon.h"
  295. +#include "fbcondecor.h"
  296. /*
  297. * Accelerated handlers.
  298. @@ -55,6 +56,13 @@
  299. area.height = height * vc->vc_font.height;
  300. area.width = width * vc->vc_font.width;
  301. + if (fbcon_decor_active(info, vc)) {
  302. + area.sx += vc->vc_decor.tx;
  303. + area.sy += vc->vc_decor.ty;
  304. + area.dx += vc->vc_decor.tx;
  305. + area.dy += vc->vc_decor.ty;
  306. + }
  307. +
  308. info->fbops->fb_copyarea(info, &area);
  309. }
  310. @@ -380,11 +388,15 @@
  311. cursor.image.depth = 1;
  312. cursor.rop = ROP_XOR;
  313. - if (info->fbops->fb_cursor)
  314. - err = info->fbops->fb_cursor(info, &cursor);
  315. + if (fbcon_decor_active(info, vc)) {
  316. + fbcon_decor_cursor(info, &cursor);
  317. + } else {
  318. + if (info->fbops->fb_cursor)
  319. + err = info->fbops->fb_cursor(info, &cursor);
  320. - if (err)
  321. - soft_cursor(info, &cursor);
  322. + if (err)
  323. + soft_cursor(info, &cursor);
  324. + }
  325. ops->cursor_reset = 0;
  326. }
  327. diff -Nur linux-3.13.7.orig/drivers/video/console/cfbcondecor.c linux-3.13.7/drivers/video/console/cfbcondecor.c
  328. --- linux-3.13.7.orig/drivers/video/console/cfbcondecor.c 1970-01-01 01:00:00.000000000 +0100
  329. +++ linux-3.13.7/drivers/video/console/cfbcondecor.c 2014-03-29 16:03:17.000000000 +0100
  330. @@ -0,0 +1,471 @@
  331. +/*
  332. + * linux/drivers/video/cfbcon_decor.c -- Framebuffer decor render functions
  333. + *
  334. + * Copyright (C) 2004 Michal Januszewski <michalj+fbcondecor@gmail.com>
  335. + *
  336. + * Code based upon "Bootdecor" (C) 2001-2003
  337. + * Volker Poplawski <volker@poplawski.de>,
  338. + * Stefan Reinauer <stepan@suse.de>,
  339. + * Steffen Winterfeldt <snwint@suse.de>,
  340. + * Michael Schroeder <mls@suse.de>,
  341. + * Ken Wimer <wimer@suse.de>.
  342. + *
  343. + * This file is subject to the terms and conditions of the GNU General Public
  344. + * License. See the file COPYING in the main directory of this archive for
  345. + * more details.
  346. + */
  347. +#include <linux/module.h>
  348. +#include <linux/types.h>
  349. +#include <linux/fb.h>
  350. +#include <linux/selection.h>
  351. +#include <linux/slab.h>
  352. +#include <linux/vt_kern.h>
  353. +#include <asm/irq.h>
  354. +
  355. +#include "fbcon.h"
  356. +#include "fbcondecor.h"
  357. +
  358. +#define parse_pixel(shift,bpp,type) \
  359. + do { \
  360. + if (d & (0x80 >> (shift))) \
  361. + dd2[(shift)] = fgx; \
  362. + else \
  363. + dd2[(shift)] = transparent ? *(type *)decor_src : bgx; \
  364. + decor_src += (bpp); \
  365. + } while (0) \
  366. +
  367. +extern int get_color(struct vc_data *vc, struct fb_info *info,
  368. + u16 c, int is_fg);
  369. +
  370. +void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc)
  371. +{
  372. + int i, j, k;
  373. + int minlen = min(min(info->var.red.length, info->var.green.length),
  374. + info->var.blue.length);
  375. + u32 col;
  376. +
  377. + for (j = i = 0; i < 16; i++) {
  378. + k = color_table[i];
  379. +
  380. + col = ((vc->vc_palette[j++] >> (8-minlen))
  381. + << info->var.red.offset);
  382. + col |= ((vc->vc_palette[j++] >> (8-minlen))
  383. + << info->var.green.offset);
  384. + col |= ((vc->vc_palette[j++] >> (8-minlen))
  385. + << info->var.blue.offset);
  386. + ((u32 *)info->pseudo_palette)[k] = col;
  387. + }
  388. +}
  389. +
  390. +void fbcon_decor_renderc(struct fb_info *info, int ypos, int xpos, int height,
  391. + int width, u8* src, u32 fgx, u32 bgx, u8 transparent)
  392. +{
  393. + unsigned int x, y;
  394. + u32 dd;
  395. + int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
  396. + unsigned int d = ypos * info->fix.line_length + xpos * bytespp;
  397. + unsigned int ds = (ypos * info->var.xres + xpos) * bytespp;
  398. + u16 dd2[4];
  399. +
  400. + u8* decor_src = (u8 *)(info->bgdecor.data + ds);
  401. + u8* dst = (u8 *)(info->screen_base + d);
  402. +
  403. + if ((ypos + height) > info->var.yres || (xpos + width) > info->var.xres)
  404. + return;
  405. +
  406. + for (y = 0; y < height; y++) {
  407. + switch (info->var.bits_per_pixel) {
  408. +
  409. + case 32:
  410. + for (x = 0; x < width; x++) {
  411. +
  412. + if ((x & 7) == 0)
  413. + d = *src++;
  414. + if (d & 0x80)
  415. + dd = fgx;
  416. + else
  417. + dd = transparent ?
  418. + *(u32 *)decor_src : bgx;
  419. +
  420. + d <<= 1;
  421. + decor_src += 4;
  422. + fb_writel(dd, dst);
  423. + dst += 4;
  424. + }
  425. + break;
  426. + case 24:
  427. + for (x = 0; x < width; x++) {
  428. +
  429. + if ((x & 7) == 0)
  430. + d = *src++;
  431. + if (d & 0x80)
  432. + dd = fgx;
  433. + else
  434. + dd = transparent ?
  435. + (*(u32 *)decor_src & 0xffffff) : bgx;
  436. +
  437. + d <<= 1;
  438. + decor_src += 3;
  439. +#ifdef __LITTLE_ENDIAN
  440. + fb_writew(dd & 0xffff, dst);
  441. + dst += 2;
  442. + fb_writeb((dd >> 16), dst);
  443. +#else
  444. + fb_writew(dd >> 8, dst);
  445. + dst += 2;
  446. + fb_writeb(dd & 0xff, dst);
  447. +#endif
  448. + dst++;
  449. + }
  450. + break;
  451. + case 16:
  452. + for (x = 0; x < width; x += 2) {
  453. + if ((x & 7) == 0)
  454. + d = *src++;
  455. +
  456. + parse_pixel(0, 2, u16);
  457. + parse_pixel(1, 2, u16);
  458. +#ifdef __LITTLE_ENDIAN
  459. + dd = dd2[0] | (dd2[1] << 16);
  460. +#else
  461. + dd = dd2[1] | (dd2[0] << 16);
  462. +#endif
  463. + d <<= 2;
  464. + fb_writel(dd, dst);
  465. + dst += 4;
  466. + }
  467. + break;
  468. +
  469. + case 8:
  470. + for (x = 0; x < width; x += 4) {
  471. + if ((x & 7) == 0)
  472. + d = *src++;
  473. +
  474. + parse_pixel(0, 1, u8);
  475. + parse_pixel(1, 1, u8);
  476. + parse_pixel(2, 1, u8);
  477. + parse_pixel(3, 1, u8);
  478. +
  479. +#ifdef __LITTLE_ENDIAN
  480. + dd = dd2[0] | (dd2[1] << 8) | (dd2[2] << 16) | (dd2[3] << 24);
  481. +#else
  482. + dd = dd2[3] | (dd2[2] << 8) | (dd2[1] << 16) | (dd2[0] << 24);
  483. +#endif
  484. + d <<= 4;
  485. + fb_writel(dd, dst);
  486. + dst += 4;
  487. + }
  488. + }
  489. +
  490. + dst += info->fix.line_length - width * bytespp;
  491. + decor_src += (info->var.xres - width) * bytespp;
  492. + }
  493. +}
  494. +
  495. +#define cc2cx(a) \
  496. + ((info->fix.visual == FB_VISUAL_TRUECOLOR || \
  497. + info->fix.visual == FB_VISUAL_DIRECTCOLOR) ? \
  498. + ((u32*)info->pseudo_palette)[a] : a)
  499. +
  500. +void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info,
  501. + const unsigned short *s, int count, int yy, int xx)
  502. +{
  503. + unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
  504. + struct fbcon_ops *ops = info->fbcon_par;
  505. + int fg_color, bg_color, transparent;
  506. + u8 *src;
  507. + u32 bgx, fgx;
  508. + u16 c = scr_readw(s);
  509. +
  510. + fg_color = get_color(vc, info, c, 1);
  511. + bg_color = get_color(vc, info, c, 0);
  512. +
  513. + /* Don't paint the background image if console is blanked */
  514. + transparent = ops->blank_state ? 0 :
  515. + (vc->vc_decor.bg_color == bg_color);
  516. +
  517. + xx = xx * vc->vc_font.width + vc->vc_decor.tx;
  518. + yy = yy * vc->vc_font.height + vc->vc_decor.ty;
  519. +
  520. + fgx = cc2cx(fg_color);
  521. + bgx = cc2cx(bg_color);
  522. +
  523. + while (count--) {
  524. + c = scr_readw(s++);
  525. + src = vc->vc_font.data + (c & charmask) * vc->vc_font.height *
  526. + ((vc->vc_font.width + 7) >> 3);
  527. +
  528. + fbcon_decor_renderc(info, yy, xx, vc->vc_font.height,
  529. + vc->vc_font.width, src, fgx, bgx, transparent);
  530. + xx += vc->vc_font.width;
  531. + }
  532. +}
  533. +
  534. +void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor)
  535. +{
  536. + int i;
  537. + unsigned int dsize, s_pitch;
  538. + struct fbcon_ops *ops = info->fbcon_par;
  539. + struct vc_data* vc;
  540. + u8 *src;
  541. +
  542. + /* we really don't need any cursors while the console is blanked */
  543. + if (info->state != FBINFO_STATE_RUNNING || ops->blank_state)
  544. + return;
  545. +
  546. + vc = vc_cons[ops->currcon].d;
  547. +
  548. + src = kmalloc(64 + sizeof(struct fb_image), GFP_ATOMIC);
  549. + if (!src)
  550. + return;
  551. +
  552. + s_pitch = (cursor->image.width + 7) >> 3;
  553. + dsize = s_pitch * cursor->image.height;
  554. + if (cursor->enable) {
  555. + switch (cursor->rop) {
  556. + case ROP_XOR:
  557. + for (i = 0; i < dsize; i++)
  558. + src[i] = cursor->image.data[i] ^ cursor->mask[i];
  559. + break;
  560. + case ROP_COPY:
  561. + default:
  562. + for (i = 0; i < dsize; i++)
  563. + src[i] = cursor->image.data[i] & cursor->mask[i];
  564. + break;
  565. + }
  566. + } else
  567. + memcpy(src, cursor->image.data, dsize);
  568. +
  569. + fbcon_decor_renderc(info,
  570. + cursor->image.dy + vc->vc_decor.ty,
  571. + cursor->image.dx + vc->vc_decor.tx,
  572. + cursor->image.height,
  573. + cursor->image.width,
  574. + (u8*)src,
  575. + cc2cx(cursor->image.fg_color),
  576. + cc2cx(cursor->image.bg_color),
  577. + cursor->image.bg_color == vc->vc_decor.bg_color);
  578. +
  579. + kfree(src);
  580. +}
  581. +
  582. +static void decorset(u8 *dst, int height, int width, int dstbytes,
  583. + u32 bgx, int bpp)
  584. +{
  585. + int i;
  586. +
  587. + if (bpp == 8)
  588. + bgx |= bgx << 8;
  589. + if (bpp == 16 || bpp == 8)
  590. + bgx |= bgx << 16;
  591. +
  592. + while (height-- > 0) {
  593. + u8 *p = dst;
  594. +
  595. + switch (bpp) {
  596. +
  597. + case 32:
  598. + for (i=0; i < width; i++) {
  599. + fb_writel(bgx, p); p += 4;
  600. + }
  601. + break;
  602. + case 24:
  603. + for (i=0; i < width; i++) {
  604. +#ifdef __LITTLE_ENDIAN
  605. + fb_writew((bgx & 0xffff),(u16*)p); p += 2;
  606. + fb_writeb((bgx >> 16),p++);
  607. +#else
  608. + fb_writew((bgx >> 8),(u16*)p); p += 2;
  609. + fb_writeb((bgx & 0xff),p++);
  610. +#endif
  611. + }
  612. + case 16:
  613. + for (i=0; i < width/4; i++) {
  614. + fb_writel(bgx,p); p += 4;
  615. + fb_writel(bgx,p); p += 4;
  616. + }
  617. + if (width & 2) {
  618. + fb_writel(bgx,p); p += 4;
  619. + }
  620. + if (width & 1)
  621. + fb_writew(bgx,(u16*)p);
  622. + break;
  623. + case 8:
  624. + for (i=0; i < width/4; i++) {
  625. + fb_writel(bgx,p); p += 4;
  626. + }
  627. +
  628. + if (width & 2) {
  629. + fb_writew(bgx,p); p += 2;
  630. + }
  631. + if (width & 1)
  632. + fb_writeb(bgx,(u8*)p);
  633. + break;
  634. +
  635. + }
  636. + dst += dstbytes;
  637. + }
  638. +}
  639. +
  640. +void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes,
  641. + int srclinebytes, int bpp)
  642. +{
  643. + int i;
  644. +
  645. + while (height-- > 0) {
  646. + u32 *p = (u32 *)dst;
  647. + u32 *q = (u32 *)src;
  648. +
  649. + switch (bpp) {
  650. +
  651. + case 32:
  652. + for (i=0; i < width; i++)
  653. + fb_writel(*q++, p++);
  654. + break;
  655. + case 24:
  656. + for (i=0; i < (width*3/4); i++)
  657. + fb_writel(*q++, p++);
  658. + if ((width*3) % 4) {
  659. + if (width & 2) {
  660. + fb_writeb(*(u8*)q, (u8*)p);
  661. + } else if (width & 1) {
  662. + fb_writew(*(u16*)q, (u16*)p);
  663. + fb_writeb(*(u8*)((u16*)q+1),(u8*)((u16*)p+2));
  664. + }
  665. + }
  666. + break;
  667. + case 16:
  668. + for (i=0; i < width/4; i++) {
  669. + fb_writel(*q++, p++);
  670. + fb_writel(*q++, p++);
  671. + }
  672. + if (width & 2)
  673. + fb_writel(*q++, p++);
  674. + if (width & 1)
  675. + fb_writew(*(u16*)q, (u16*)p);
  676. + break;
  677. + case 8:
  678. + for (i=0; i < width/4; i++)
  679. + fb_writel(*q++, p++);
  680. +
  681. + if (width & 2) {
  682. + fb_writew(*(u16*)q, (u16*)p);
  683. + q = (u32*) ((u16*)q + 1);
  684. + p = (u32*) ((u16*)p + 1);
  685. + }
  686. + if (width & 1)
  687. + fb_writeb(*(u8*)q, (u8*)p);
  688. + break;
  689. + }
  690. +
  691. + dst += linebytes;
  692. + src += srclinebytes;
  693. + }
  694. +}
  695. +
  696. +static void decorfill(struct fb_info *info, int sy, int sx, int height,
  697. + int width)
  698. +{
  699. + int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
  700. + int d = sy * info->fix.line_length + sx * bytespp;
  701. + int ds = (sy * info->var.xres + sx) * bytespp;
  702. +
  703. + fbcon_decor_copy((u8 *)(info->screen_base + d), (u8 *)(info->bgdecor.data + ds),
  704. + height, width, info->fix.line_length, info->var.xres * bytespp,
  705. + info->var.bits_per_pixel);
  706. +}
  707. +
  708. +void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx,
  709. + int height, int width)
  710. +{
  711. + int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
  712. + struct fbcon_ops *ops = info->fbcon_par;
  713. + u8 *dst;
  714. + int transparent, bg_color = attr_bgcol_ec(bgshift, vc, info);
  715. +
  716. + transparent = (vc->vc_decor.bg_color == bg_color);
  717. + sy = sy * vc->vc_font.height + vc->vc_decor.ty;
  718. + sx = sx * vc->vc_font.width + vc->vc_decor.tx;
  719. + height *= vc->vc_font.height;
  720. + width *= vc->vc_font.width;
  721. +
  722. + /* Don't paint the background image if console is blanked */
  723. + if (transparent && !ops->blank_state) {
  724. + decorfill(info, sy, sx, height, width);
  725. + } else {
  726. + dst = (u8 *)(info->screen_base + sy * info->fix.line_length +
  727. + sx * ((info->var.bits_per_pixel + 7) >> 3));
  728. + decorset(dst, height, width, info->fix.line_length, cc2cx(bg_color),
  729. + info->var.bits_per_pixel);
  730. + }
  731. +}
  732. +
  733. +void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info,
  734. + int bottom_only)
  735. +{
  736. + unsigned int tw = vc->vc_cols*vc->vc_font.width;
  737. + unsigned int th = vc->vc_rows*vc->vc_font.height;
  738. +
  739. + if (!bottom_only) {
  740. + /* top margin */
  741. + decorfill(info, 0, 0, vc->vc_decor.ty, info->var.xres);
  742. + /* left margin */
  743. + decorfill(info, vc->vc_decor.ty, 0, th, vc->vc_decor.tx);
  744. + /* right margin */
  745. + decorfill(info, vc->vc_decor.ty, vc->vc_decor.tx + tw, th,
  746. + info->var.xres - vc->vc_decor.tx - tw);
  747. + }
  748. + decorfill(info, vc->vc_decor.ty + th, 0,
  749. + info->var.yres - vc->vc_decor.ty - th, info->var.xres);
  750. +}
  751. +
  752. +void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y,
  753. + int sx, int dx, int width)
  754. +{
  755. + u16 *d = (u16 *) (vc->vc_origin + vc->vc_size_row * y + dx * 2);
  756. + u16 *s = d + (dx - sx);
  757. + u16 *start = d;
  758. + u16 *ls = d;
  759. + u16 *le = d + width;
  760. + u16 c;
  761. + int x = dx;
  762. + u16 attr = 1;
  763. +
  764. + do {
  765. + c = scr_readw(d);
  766. + if (attr != (c & 0xff00)) {
  767. + attr = c & 0xff00;
  768. + if (d > start) {
  769. + fbcon_decor_putcs(vc, info, start, d - start, y, x);
  770. + x += d - start;
  771. + start = d;
  772. + }
  773. + }
  774. + if (s >= ls && s < le && c == scr_readw(s)) {
  775. + if (d > start) {
  776. + fbcon_decor_putcs(vc, info, start, d - start, y, x);
  777. + x += d - start + 1;
  778. + start = d + 1;
  779. + } else {
  780. + x++;
  781. + start++;
  782. + }
  783. + }
  784. + s++;
  785. + d++;
  786. + } while (d < le);
  787. + if (d > start)
  788. + fbcon_decor_putcs(vc, info, start, d - start, y, x);
  789. +}
  790. +
  791. +void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank)
  792. +{
  793. + if (blank) {
  794. + decorset((u8 *)info->screen_base, info->var.yres, info->var.xres,
  795. + info->fix.line_length, 0, info->var.bits_per_pixel);
  796. + } else {
  797. + update_screen(vc);
  798. + fbcon_decor_clear_margins(vc, info, 0);
  799. + }
  800. +}
  801. +
  802. diff -Nur linux-3.13.7.orig/drivers/video/console/fbcon.c linux-3.13.7/drivers/video/console/fbcon.c
  803. --- linux-3.13.7.orig/drivers/video/console/fbcon.c 2014-03-24 05:45:42.000000000 +0100
  804. +++ linux-3.13.7/drivers/video/console/fbcon.c 2014-03-29 16:03:17.000000000 +0100
  805. @@ -79,6 +79,7 @@
  806. #include <asm/irq.h>
  807. #include "fbcon.h"
  808. +#include "fbcondecor.h"
  809. #ifdef FBCONDEBUG
  810. # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
  811. @@ -94,7 +95,7 @@
  812. static struct display fb_display[MAX_NR_CONSOLES];
  813. -static signed char con2fb_map[MAX_NR_CONSOLES];
  814. +signed char con2fb_map[MAX_NR_CONSOLES];
  815. static signed char con2fb_map_boot[MAX_NR_CONSOLES];
  816. static int logo_lines;
  817. @@ -286,7 +287,7 @@
  818. !vt_force_oops_output(vc);
  819. }
  820. -static int get_color(struct vc_data *vc, struct fb_info *info,
  821. +int get_color(struct vc_data *vc, struct fb_info *info,
  822. u16 c, int is_fg)
  823. {
  824. int depth = fb_get_color_depth(&info->var, &info->fix);
  825. @@ -551,6 +552,9 @@
  826. info_idx = -1;
  827. } else {
  828. fbcon_has_console_bind = 1;
  829. +#ifdef CONFIG_FB_CON_DECOR
  830. + fbcon_decor_init();
  831. +#endif
  832. }
  833. return err;
  834. @@ -1007,6 +1011,12 @@
  835. rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
  836. cols /= vc->vc_font.width;
  837. rows /= vc->vc_font.height;
  838. +
  839. + if (fbcon_decor_active(info, vc)) {
  840. + cols = vc->vc_decor.twidth / vc->vc_font.width;
  841. + rows = vc->vc_decor.theight / vc->vc_font.height;
  842. + }
  843. +
  844. vc_resize(vc, cols, rows);
  845. DPRINTK("mode: %s\n", info->fix.id);
  846. @@ -1036,7 +1046,7 @@
  847. cap = info->flags;
  848. if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
  849. - (info->fix.type == FB_TYPE_TEXT))
  850. + (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc))
  851. logo = 0;
  852. if (var_to_display(p, &info->var, info))
  853. @@ -1260,6 +1270,11 @@
  854. fbcon_clear_margins(vc, 0);
  855. }
  856. + if (fbcon_decor_active(info, vc)) {
  857. + fbcon_decor_clear(vc, info, sy, sx, height, width);
  858. + return;
  859. + }
  860. +
  861. /* Split blits that cross physical y_wrap boundary */
  862. y_break = p->vrows - p->yscroll;
  863. @@ -1279,10 +1294,15 @@
  864. struct display *p = &fb_display[vc->vc_num];
  865. struct fbcon_ops *ops = info->fbcon_par;
  866. - if (!fbcon_is_inactive(vc, info))
  867. - ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
  868. - get_color(vc, info, scr_readw(s), 1),
  869. - get_color(vc, info, scr_readw(s), 0));
  870. + if (!fbcon_is_inactive(vc, info)) {
  871. +
  872. + if (fbcon_decor_active(info, vc))
  873. + fbcon_decor_putcs(vc, info, s, count, ypos, xpos);
  874. + else
  875. + ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
  876. + get_color(vc, info, scr_readw(s), 1),
  877. + get_color(vc, info, scr_readw(s), 0));
  878. + }
  879. }
  880. static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
  881. @@ -1298,8 +1318,13 @@
  882. struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
  883. struct fbcon_ops *ops = info->fbcon_par;
  884. - if (!fbcon_is_inactive(vc, info))
  885. - ops->clear_margins(vc, info, bottom_only);
  886. + if (!fbcon_is_inactive(vc, info)) {
  887. + if (fbcon_decor_active(info, vc)) {
  888. + fbcon_decor_clear_margins(vc, info, bottom_only);
  889. + } else {
  890. + ops->clear_margins(vc, info, bottom_only);
  891. + }
  892. + }
  893. }
  894. static void fbcon_cursor(struct vc_data *vc, int mode)
  895. @@ -1819,7 +1844,7 @@
  896. count = vc->vc_rows;
  897. if (softback_top)
  898. fbcon_softback_note(vc, t, count);
  899. - if (logo_shown >= 0)
  900. + if (logo_shown >= 0 || fbcon_decor_active(info, vc))
  901. goto redraw_up;
  902. switch (p->scrollmode) {
  903. case SCROLL_MOVE:
  904. @@ -1912,6 +1937,8 @@
  905. count = vc->vc_rows;
  906. if (logo_shown >= 0)
  907. goto redraw_down;
  908. + if (fbcon_decor_active(info, vc))
  909. + goto redraw_down;
  910. switch (p->scrollmode) {
  911. case SCROLL_MOVE:
  912. fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,
  913. @@ -2060,6 +2087,13 @@
  914. }
  915. return;
  916. }
  917. +
  918. + if (fbcon_decor_active(info, vc) && sy == dy && height == 1) {
  919. + /* must use slower redraw bmove to keep background pic intact */
  920. + fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width);
  921. + return;
  922. + }
  923. +
  924. ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
  925. height, width);
  926. }
  927. @@ -2130,8 +2164,8 @@
  928. var.yres = virt_h * virt_fh;
  929. x_diff = info->var.xres - var.xres;
  930. y_diff = info->var.yres - var.yres;
  931. - if (x_diff < 0 || x_diff > virt_fw ||
  932. - y_diff < 0 || y_diff > virt_fh) {
  933. + if ((x_diff < 0 || x_diff > virt_fw ||
  934. + y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) {
  935. const struct fb_videomode *mode;
  936. DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
  937. @@ -2167,6 +2201,21 @@
  938. info = registered_fb[con2fb_map[vc->vc_num]];
  939. ops = info->fbcon_par;
  940. + prev_console = ops->currcon;
  941. + if (prev_console != -1)
  942. + old_info = registered_fb[con2fb_map[prev_console]];
  943. +
  944. +#ifdef CONFIG_FB_CON_DECOR
  945. + if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
  946. + struct vc_data *vc_curr = vc_cons[prev_console].d;
  947. + if (vc_curr && fbcon_decor_active_vc(vc_curr)) {
  948. + /* Clear the screen to avoid displaying funky colors during
  949. + * palette updates. */
  950. + memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset,
  951. + 0, info->var.yres * info->fix.line_length);
  952. + }
  953. + }
  954. +#endif
  955. if (softback_top) {
  956. if (softback_lines)
  957. @@ -2185,9 +2234,6 @@
  958. logo_shown = FBCON_LOGO_CANSHOW;
  959. }
  960. - prev_console = ops->currcon;
  961. - if (prev_console != -1)
  962. - old_info = registered_fb[con2fb_map[prev_console]];
  963. /*
  964. * FIXME: If we have multiple fbdev's loaded, we need to
  965. * update all info->currcon. Perhaps, we can place this
  966. @@ -2231,6 +2277,18 @@
  967. fbcon_del_cursor_timer(old_info);
  968. }
  969. + if (fbcon_decor_active_vc(vc)) {
  970. + struct vc_data *vc_curr = vc_cons[prev_console].d;
  971. +
  972. + if (!vc_curr->vc_decor.theme ||
  973. + strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) ||
  974. + (fbcon_decor_active_nores(info, vc_curr) &&
  975. + !fbcon_decor_active(info, vc_curr))) {
  976. + fbcon_decor_disable(vc, 0);
  977. + fbcon_decor_call_helper("modechange", vc->vc_num);
  978. + }
  979. + }
  980. +
  981. if (fbcon_is_inactive(vc, info) ||
  982. ops->blank_state != FB_BLANK_UNBLANK)
  983. fbcon_del_cursor_timer(info);
  984. @@ -2339,15 +2397,20 @@
  985. }
  986. }
  987. - if (!fbcon_is_inactive(vc, info)) {
  988. + if (!fbcon_is_inactive(vc, info)) {
  989. if (ops->blank_state != blank) {
  990. ops->blank_state = blank;
  991. fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
  992. ops->cursor_flash = (!blank);
  993. - if (!(info->flags & FBINFO_MISC_USEREVENT))
  994. - if (fb_blank(info, blank))
  995. - fbcon_generic_blank(vc, info, blank);
  996. + if (!(info->flags & FBINFO_MISC_USEREVENT)) {
  997. + if (fb_blank(info, blank)) {
  998. + if (fbcon_decor_active(info, vc))
  999. + fbcon_decor_blank(vc, info, blank);
  1000. + else
  1001. + fbcon_generic_blank(vc, info, blank);
  1002. + }
  1003. + }
  1004. }
  1005. if (!blank)
  1006. @@ -2522,13 +2585,22 @@
  1007. }
  1008. if (resize) {
  1009. + /* reset wrap/pan */
  1010. int cols, rows;
  1011. cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
  1012. rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
  1013. +
  1014. + if (fbcon_decor_active(info, vc)) {
  1015. + info->var.xoffset = info->var.yoffset = p->yscroll = 0;
  1016. + cols = vc->vc_decor.twidth;
  1017. + rows = vc->vc_decor.theight;
  1018. + }
  1019. cols /= w;
  1020. rows /= h;
  1021. +
  1022. vc_resize(vc, cols, rows);
  1023. +
  1024. if (CON_IS_VISIBLE(vc) && softback_buf)
  1025. fbcon_update_softback(vc);
  1026. } else if (CON_IS_VISIBLE(vc)
  1027. @@ -2657,7 +2729,11 @@
  1028. int i, j, k, depth;
  1029. u8 val;
  1030. - if (fbcon_is_inactive(vc, info))
  1031. + if (fbcon_is_inactive(vc, info)
  1032. +#ifdef CONFIG_FB_CON_DECOR
  1033. + || vc->vc_num != fg_console
  1034. +#endif
  1035. + )
  1036. return -EINVAL;
  1037. if (!CON_IS_VISIBLE(vc))
  1038. @@ -2683,14 +2759,56 @@
  1039. } else
  1040. fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap);
  1041. - return fb_set_cmap(&palette_cmap, info);
  1042. + if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
  1043. + info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
  1044. +
  1045. + u16 *red, *green, *blue;
  1046. + int minlen = min(min(info->var.red.length, info->var.green.length),
  1047. + info->var.blue.length);
  1048. + int h;
  1049. +
  1050. + struct fb_cmap cmap = {
  1051. + .start = 0,
  1052. + .len = (1 << minlen),
  1053. + .red = NULL,
  1054. + .green = NULL,
  1055. + .blue = NULL,
  1056. + .transp = NULL
  1057. + };
  1058. +
  1059. + red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL);
  1060. +
  1061. + if (!red)
  1062. + goto out;
  1063. +
  1064. + green = red + 256;
  1065. + blue = green + 256;
  1066. + cmap.red = red;
  1067. + cmap.green = green;
  1068. + cmap.blue = blue;
  1069. +
  1070. + for (i = 0; i < cmap.len; i++) {
  1071. + red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1);
  1072. + }
  1073. +
  1074. + h = fb_set_cmap(&cmap, info);
  1075. + fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
  1076. + kfree(red);
  1077. +
  1078. + return h;
  1079. +
  1080. + } else if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
  1081. + info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL)
  1082. + fb_set_cmap(&info->bgdecor.cmap, info);
  1083. +
  1084. +out: return fb_set_cmap(&palette_cmap, info);
  1085. }
  1086. static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
  1087. {
  1088. unsigned long p;
  1089. int line;
  1090. -
  1091. +
  1092. if (vc->vc_num != fg_console || !softback_lines)
  1093. return (u16 *) (vc->vc_origin + offset);
  1094. line = offset / vc->vc_size_row;
  1095. @@ -2909,7 +3027,14 @@
  1096. rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
  1097. cols /= vc->vc_font.width;
  1098. rows /= vc->vc_font.height;
  1099. - vc_resize(vc, cols, rows);
  1100. +
  1101. + if (!fbcon_decor_active_nores(info, vc)) {
  1102. + vc_resize(vc, cols, rows);
  1103. + } else {
  1104. + fbcon_decor_disable(vc, 0);
  1105. + fbcon_decor_call_helper("modechange", vc->vc_num);
  1106. + }
  1107. +
  1108. updatescrollmode(p, info, vc);
  1109. scrollback_max = 0;
  1110. scrollback_current = 0;
  1111. @@ -2954,7 +3079,9 @@
  1112. rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
  1113. cols /= vc->vc_font.width;
  1114. rows /= vc->vc_font.height;
  1115. - vc_resize(vc, cols, rows);
  1116. + if (!fbcon_decor_active_nores(info, vc)) {
  1117. + vc_resize(vc, cols, rows);
  1118. + }
  1119. }
  1120. if (fg != -1)
  1121. @@ -3570,6 +3697,7 @@
  1122. }
  1123. }
  1124. + fbcon_decor_exit();
  1125. fbcon_has_exited = 1;
  1126. }
  1127. diff -Nur linux-3.13.7.orig/drivers/video/console/fbcondecor.c linux-3.13.7/drivers/video/console/fbcondecor.c
  1128. --- linux-3.13.7.orig/drivers/video/console/fbcondecor.c 1970-01-01 01:00:00.000000000 +0100
  1129. +++ linux-3.13.7/drivers/video/console/fbcondecor.c 2014-03-29 16:03:17.000000000 +0100
  1130. @@ -0,0 +1,555 @@
  1131. +/*
  1132. + * linux/drivers/video/console/fbcondecor.c -- Framebuffer console decorations
  1133. + *
  1134. + * Copyright (C) 2004-2009 Michal Januszewski <michalj+fbcondecor@gmail.com>
  1135. + *
  1136. + * Code based upon "Bootsplash" (C) 2001-2003
  1137. + * Volker Poplawski <volker@poplawski.de>,
  1138. + * Stefan Reinauer <stepan@suse.de>,
  1139. + * Steffen Winterfeldt <snwint@suse.de>,
  1140. + * Michael Schroeder <mls@suse.de>,
  1141. + * Ken Wimer <wimer@suse.de>.
  1142. + *
  1143. + * Compat ioctl support by Thorsten Klein <TK@Thorsten-Klein.de>.
  1144. + *
  1145. + * This file is subject to the terms and conditions of the GNU General Public
  1146. + * License. See the file COPYING in the main directory of this archive for
  1147. + * more details.
  1148. + *
  1149. + */
  1150. +#include <linux/module.h>
  1151. +#include <linux/kernel.h>
  1152. +#include <linux/string.h>
  1153. +#include <linux/types.h>
  1154. +#include <linux/fb.h>
  1155. +#include <linux/vt_kern.h>
  1156. +#include <linux/vmalloc.h>
  1157. +#include <linux/unistd.h>
  1158. +#include <linux/syscalls.h>
  1159. +#include <linux/init.h>
  1160. +#include <linux/proc_fs.h>
  1161. +#include <linux/workqueue.h>
  1162. +#include <linux/kmod.h>
  1163. +#include <linux/miscdevice.h>
  1164. +#include <linux/device.h>
  1165. +#include <linux/fs.h>
  1166. +#include <linux/compat.h>
  1167. +#include <linux/console.h>
  1168. +
  1169. +#include <asm/uaccess.h>
  1170. +#include <asm/irq.h>
  1171. +
  1172. +#include "fbcon.h"
  1173. +#include "fbcondecor.h"
  1174. +
  1175. +extern signed char con2fb_map[];
  1176. +static int fbcon_decor_enable(struct vc_data *vc);
  1177. +char fbcon_decor_path[KMOD_PATH_LEN] = "/sbin/fbcondecor_helper";
  1178. +static int initialized = 0;
  1179. +
  1180. +int fbcon_decor_call_helper(char* cmd, unsigned short vc)
  1181. +{
  1182. + char *envp[] = {
  1183. + "HOME=/",
  1184. + "PATH=/sbin:/bin",
  1185. + NULL
  1186. + };
  1187. +
  1188. + char tfb[5];
  1189. + char tcons[5];
  1190. + unsigned char fb = (int) con2fb_map[vc];
  1191. +
  1192. + char *argv[] = {
  1193. + fbcon_decor_path,
  1194. + "2",
  1195. + cmd,
  1196. + tcons,
  1197. + tfb,
  1198. + vc_cons[vc].d->vc_decor.theme,
  1199. + NULL
  1200. + };
  1201. +
  1202. + snprintf(tfb,5,"%d",fb);
  1203. + snprintf(tcons,5,"%d",vc);
  1204. +
  1205. + return call_usermodehelper(fbcon_decor_path, argv, envp, UMH_WAIT_EXEC);
  1206. +}
  1207. +
  1208. +/* Disables fbcondecor on a virtual console; called with console sem held. */
  1209. +int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw)
  1210. +{
  1211. + struct fb_info* info;
  1212. +
  1213. + if (!vc->vc_decor.state)
  1214. + return -EINVAL;
  1215. +
  1216. + info = registered_fb[(int) con2fb_map[vc->vc_num]];
  1217. +
  1218. + if (info == NULL)
  1219. + return -EINVAL;
  1220. +
  1221. + vc->vc_decor.state = 0;
  1222. + vc_resize(vc, info->var.xres / vc->vc_font.width,
  1223. + info->var.yres / vc->vc_font.height);
  1224. +
  1225. + if (fg_console == vc->vc_num && redraw) {
  1226. + redraw_screen(vc, 0);
  1227. + update_region(vc, vc->vc_origin +
  1228. + vc->vc_size_row * vc->vc_top,
  1229. + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
  1230. + }
  1231. +
  1232. + printk(KERN_INFO "fbcondecor: switched decor state to 'off' on console %d\n",
  1233. + vc->vc_num);
  1234. +
  1235. + return 0;
  1236. +}
  1237. +
  1238. +/* Enables fbcondecor on a virtual console; called with console sem held. */
  1239. +static int fbcon_decor_enable(struct vc_data *vc)
  1240. +{
  1241. + struct fb_info* info;
  1242. +
  1243. + info = registered_fb[(int) con2fb_map[vc->vc_num]];
  1244. +
  1245. + if (vc->vc_decor.twidth == 0 || vc->vc_decor.theight == 0 ||
  1246. + info == NULL || vc->vc_decor.state || (!info->bgdecor.data &&
  1247. + vc->vc_num == fg_console))
  1248. + return -EINVAL;
  1249. +
  1250. + vc->vc_decor.state = 1;
  1251. + vc_resize(vc, vc->vc_decor.twidth / vc->vc_font.width,
  1252. + vc->vc_decor.theight / vc->vc_font.height);
  1253. +
  1254. + if (fg_console == vc->vc_num) {
  1255. + redraw_screen(vc, 0);
  1256. + update_region(vc, vc->vc_origin +
  1257. + vc->vc_size_row * vc->vc_top,
  1258. + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
  1259. + fbcon_decor_clear_margins(vc, info, 0);
  1260. + }
  1261. +
  1262. + printk(KERN_INFO "fbcondecor: switched decor state to 'on' on console %d\n",
  1263. + vc->vc_num);
  1264. +
  1265. + return 0;
  1266. +}
  1267. +
  1268. +static inline int fbcon_decor_ioctl_dosetstate(struct vc_data *vc, unsigned int state, unsigned char origin)
  1269. +{
  1270. + int ret;
  1271. +
  1272. +// if (origin == FBCON_DECOR_IO_ORIG_USER)
  1273. + console_lock();
  1274. + if (!state)
  1275. + ret = fbcon_decor_disable(vc, 1);
  1276. + else
  1277. + ret = fbcon_decor_enable(vc);
  1278. +// if (origin == FBCON_DECOR_IO_ORIG_USER)
  1279. + console_unlock();
  1280. +
  1281. + return ret;
  1282. +}
  1283. +
  1284. +static inline void fbcon_decor_ioctl_dogetstate(struct vc_data *vc, unsigned int *state)
  1285. +{
  1286. + *state = vc->vc_decor.state;
  1287. +}
  1288. +
  1289. +static int fbcon_decor_ioctl_dosetcfg(struct vc_data *vc, struct vc_decor *cfg, unsigned char origin)
  1290. +{
  1291. + struct fb_info *info;
  1292. + int len;
  1293. + char *tmp;
  1294. +
  1295. + info = registered_fb[(int) con2fb_map[vc->vc_num]];
  1296. +
  1297. + if (info == NULL || !cfg->twidth || !cfg->theight ||
  1298. + cfg->tx + cfg->twidth > info->var.xres ||
  1299. + cfg->ty + cfg->theight > info->var.yres)
  1300. + return -EINVAL;
  1301. +
  1302. + len = strlen_user(cfg->theme);
  1303. + if (!len || len > FBCON_DECOR_THEME_LEN)
  1304. + return -EINVAL;
  1305. + tmp = kmalloc(len, GFP_KERNEL);
  1306. + if (!tmp)
  1307. + return -ENOMEM;
  1308. + if (copy_from_user(tmp, (void __user *)cfg->theme, len))
  1309. + return -EFAULT;
  1310. + cfg->theme = tmp;
  1311. + cfg->state = 0;
  1312. +
  1313. + /* If this ioctl is a response to a request from kernel, the console sem
  1314. + * is already held; we also don't need to disable decor because either the
  1315. + * new config and background picture will be successfully loaded, and the
  1316. + * decor will stay on, or in case of a failure it'll be turned off in fbcon. */
  1317. +// if (origin == FBCON_DECOR_IO_ORIG_USER) {
  1318. + console_lock();
  1319. + if (vc->vc_decor.state)
  1320. + fbcon_decor_disable(vc, 1);
  1321. +// }
  1322. +
  1323. + if (vc->vc_decor.theme)
  1324. + kfree(vc->vc_decor.theme);
  1325. +
  1326. + vc->vc_decor = *cfg;
  1327. +
  1328. +// if (origin == FBCON_DECOR_IO_ORIG_USER)
  1329. + console_unlock();
  1330. +
  1331. + printk(KERN_INFO "fbcondecor: console %d using theme '%s'\n",
  1332. + vc->vc_num, vc->vc_decor.theme);
  1333. + return 0;
  1334. +}
  1335. +
  1336. +static int fbcon_decor_ioctl_dogetcfg(struct vc_data *vc, struct vc_decor *decor)
  1337. +{
  1338. + char __user *tmp;
  1339. +
  1340. + tmp = decor->theme;
  1341. + *decor = vc->vc_decor;
  1342. + decor->theme = tmp;
  1343. +
  1344. + if (vc->vc_decor.theme) {
  1345. + if (copy_to_user(tmp, vc->vc_decor.theme, strlen(vc->vc_decor.theme) + 1))
  1346. + return -EFAULT;
  1347. + } else
  1348. + if (put_user(0, tmp))
  1349. + return -EFAULT;
  1350. +
  1351. + return 0;
  1352. +}
  1353. +
  1354. +static int fbcon_decor_ioctl_dosetpic(struct vc_data *vc, struct fb_image *img, unsigned char origin)
  1355. +{
  1356. + struct fb_info *info;
  1357. + int len;
  1358. + u8 *tmp;
  1359. +
  1360. + if (vc->vc_num != fg_console)
  1361. + return -EINVAL;
  1362. +
  1363. + info = registered_fb[(int) con2fb_map[vc->vc_num]];
  1364. +
  1365. + if (info == NULL)
  1366. + return -EINVAL;
  1367. +
  1368. + if (img->width != info->var.xres || img->height != info->var.yres) {
  1369. + printk(KERN_ERR "fbcondecor: picture dimensions mismatch\n");
  1370. + printk(KERN_ERR "%dx%d vs %dx%d\n", img->width, img->height, info->var.xres, info->var.yres);
  1371. + return -EINVAL;
  1372. + }
  1373. +
  1374. + if (img->depth != info->var.bits_per_pixel) {
  1375. + printk(KERN_ERR "fbcondecor: picture depth mismatch\n");
  1376. + return -EINVAL;
  1377. + }
  1378. +
  1379. + if (img->depth == 8) {
  1380. + if (!img->cmap.len || !img->cmap.red || !img->cmap.green ||
  1381. + !img->cmap.blue)
  1382. + return -EINVAL;
  1383. +
  1384. + tmp = vmalloc(img->cmap.len * 3 * 2);
  1385. + if (!tmp)
  1386. + return -ENOMEM;
  1387. +
  1388. + if (copy_from_user(tmp,
  1389. + (void __user*)img->cmap.red, (img->cmap.len << 1)) ||
  1390. + copy_from_user(tmp + (img->cmap.len << 1),
  1391. + (void __user*)img->cmap.green, (img->cmap.len << 1)) ||
  1392. + copy_from_user(tmp + (img->cmap.len << 2),
  1393. + (void __user*)img->cmap.blue, (img->cmap.len << 1))) {
  1394. + vfree(tmp);
  1395. + return -EFAULT;
  1396. + }
  1397. +
  1398. + img->cmap.transp = NULL;
  1399. + img->cmap.red = (u16*)tmp;
  1400. + img->cmap.green = img->cmap.red + img->cmap.len;
  1401. + img->cmap.blue = img->cmap.green + img->cmap.len;
  1402. + } else {
  1403. + img->cmap.red = NULL;
  1404. + }
  1405. +
  1406. + len = ((img->depth + 7) >> 3) * img->width * img->height;
  1407. +
  1408. + /*
  1409. + * Allocate an additional byte so that we never go outside of the
  1410. + * buffer boundaries in the rendering functions in a 24 bpp mode.
  1411. + */
  1412. + tmp = vmalloc(len + 1);
  1413. +
  1414. + if (!tmp)
  1415. + goto out;
  1416. +
  1417. + if (copy_from_user(tmp, (void __user*)img->data, len))
  1418. + goto out;
  1419. +
  1420. + img->data = tmp;
  1421. +
  1422. + /* If this ioctl is a response to a request from kernel, the console sem
  1423. + * is already held. */
  1424. +// if (origin == FBCON_DECOR_IO_ORIG_USER)
  1425. + console_lock();
  1426. +
  1427. + if (info->bgdecor.data)
  1428. + vfree((u8*)info->bgdecor.data);
  1429. + if (info->bgdecor.cmap.red)
  1430. + vfree(info->bgdecor.cmap.red);
  1431. +
  1432. + info->bgdecor = *img;
  1433. +
  1434. + if (fbcon_decor_active_vc(vc) && fg_console == vc->vc_num) {
  1435. + redraw_screen(vc, 0);
  1436. + update_region(vc, vc->vc_origin +
  1437. + vc->vc_size_row * vc->vc_top,
  1438. + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
  1439. + fbcon_decor_clear_margins(vc, info, 0);
  1440. + }
  1441. +
  1442. +// if (origin == FBCON_DECOR_IO_ORIG_USER)
  1443. + console_unlock();
  1444. +
  1445. + return 0;
  1446. +
  1447. +out: if (img->cmap.red)
  1448. + vfree(img->cmap.red);
  1449. +
  1450. + if (tmp)
  1451. + vfree(tmp);
  1452. + return -ENOMEM;
  1453. +}
  1454. +
  1455. +static long fbcon_decor_ioctl(struct file *filp, u_int cmd, u_long arg)
  1456. +{
  1457. + struct fbcon_decor_iowrapper __user *wrapper = (void __user*) arg;
  1458. + struct vc_data *vc = NULL;
  1459. + unsigned short vc_num = 0;
  1460. + unsigned char origin = 0;
  1461. + void __user *data = NULL;
  1462. +
  1463. + if (!access_ok(VERIFY_READ, wrapper,
  1464. + sizeof(struct fbcon_decor_iowrapper)))
  1465. + return -EFAULT;
  1466. +
  1467. + __get_user(vc_num, &wrapper->vc);
  1468. + __get_user(origin, &wrapper->origin);
  1469. + __get_user(data, &wrapper->data);
  1470. +
  1471. + if (!vc_cons_allocated(vc_num))
  1472. + return -EINVAL;
  1473. +
  1474. + vc = vc_cons[vc_num].d;
  1475. +
  1476. + switch (cmd) {
  1477. + case FBIOCONDECOR_SETPIC:
  1478. + {
  1479. + struct fb_image img;
  1480. + if (copy_from_user(&img, (struct fb_image __user *)data, sizeof(struct fb_image)))
  1481. + return -EFAULT;
  1482. +
  1483. + return fbcon_decor_ioctl_dosetpic(vc, &img, origin);
  1484. + }
  1485. + case FBIOCONDECOR_SETCFG:
  1486. + {
  1487. + struct vc_decor cfg;
  1488. + if (copy_from_user(&cfg, (struct vc_decor __user *)data, sizeof(struct vc_decor)))
  1489. + return -EFAULT;
  1490. +
  1491. + return fbcon_decor_ioctl_dosetcfg(vc, &cfg, origin);
  1492. + }
  1493. + case FBIOCONDECOR_GETCFG:
  1494. + {
  1495. + int rval;
  1496. + struct vc_decor cfg;
  1497. +
  1498. + if (copy_from_user(&cfg, (struct vc_decor __user *)data, sizeof(struct vc_decor)))
  1499. + return -EFAULT;
  1500. +
  1501. + rval = fbcon_decor_ioctl_dogetcfg(vc, &cfg);
  1502. +
  1503. + if (copy_to_user(data, &cfg, sizeof(struct vc_decor)))
  1504. + return -EFAULT;
  1505. + return rval;
  1506. + }
  1507. + case FBIOCONDECOR_SETSTATE:
  1508. + {
  1509. + unsigned int state = 0;
  1510. + if (get_user(state, (unsigned int __user *)data))
  1511. + return -EFAULT;
  1512. + return fbcon_decor_ioctl_dosetstate(vc, state, origin);
  1513. + }
  1514. + case FBIOCONDECOR_GETSTATE:
  1515. + {
  1516. + unsigned int state = 0;
  1517. + fbcon_decor_ioctl_dogetstate(vc, &state);
  1518. + return put_user(state, (unsigned int __user *)data);
  1519. + }
  1520. +
  1521. + default:
  1522. + return -ENOIOCTLCMD;
  1523. + }
  1524. +}
  1525. +
  1526. +#ifdef CONFIG_COMPAT
  1527. +
  1528. +static long fbcon_decor_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) {
  1529. +
  1530. + struct fbcon_decor_iowrapper32 __user *wrapper = (void __user *)arg;
  1531. + struct vc_data *vc = NULL;
  1532. + unsigned short vc_num = 0;
  1533. + unsigned char origin = 0;
  1534. + compat_uptr_t data_compat = 0;
  1535. + void __user *data = NULL;
  1536. +
  1537. + if (!access_ok(VERIFY_READ, wrapper,
  1538. + sizeof(struct fbcon_decor_iowrapper32)))
  1539. + return -EFAULT;
  1540. +
  1541. + __get_user(vc_num, &wrapper->vc);
  1542. + __get_user(origin, &wrapper->origin);
  1543. + __get_user(data_compat, &wrapper->data);
  1544. + data = compat_ptr(data_compat);
  1545. +
  1546. + if (!vc_cons_allocated(vc_num))
  1547. + return -EINVAL;
  1548. +
  1549. + vc = vc_cons[vc_num].d;
  1550. +
  1551. + switch (cmd) {
  1552. + case FBIOCONDECOR_SETPIC32:
  1553. + {
  1554. + struct fb_image32 img_compat;
  1555. + struct fb_image img;
  1556. +
  1557. + if (copy_from_user(&img_compat, (struct fb_image32 __user *)data, sizeof(struct fb_image32)))
  1558. + return -EFAULT;
  1559. +
  1560. + fb_image_from_compat(img, img_compat);
  1561. +
  1562. + return fbcon_decor_ioctl_dosetpic(vc, &img, origin);
  1563. + }
  1564. +
  1565. + case FBIOCONDECOR_SETCFG32:
  1566. + {
  1567. + struct vc_decor32 cfg_compat;
  1568. + struct vc_decor cfg;
  1569. +
  1570. + if (copy_from_user(&cfg_compat, (struct vc_decor32 __user *)data, sizeof(struct vc_decor32)))
  1571. + return -EFAULT;
  1572. +
  1573. + vc_decor_from_compat(cfg, cfg_compat);
  1574. +
  1575. + return fbcon_decor_ioctl_dosetcfg(vc, &cfg, origin);
  1576. + }
  1577. +
  1578. + case FBIOCONDECOR_GETCFG32:
  1579. + {
  1580. + int rval;
  1581. + struct vc_decor32 cfg_compat;
  1582. + struct vc_decor cfg;
  1583. +
  1584. + if (copy_from_user(&cfg_compat, (struct vc_decor32 __user *)data, sizeof(struct vc_decor32)))
  1585. + return -EFAULT;
  1586. + cfg.theme = compat_ptr(cfg_compat.theme);
  1587. +
  1588. + rval = fbcon_decor_ioctl_dogetcfg(vc, &cfg);
  1589. +
  1590. + vc_decor_to_compat(cfg_compat, cfg);
  1591. +
  1592. + if (copy_to_user((struct vc_decor32 __user *)data, &cfg_compat, sizeof(struct vc_decor32)))
  1593. + return -EFAULT;
  1594. + return rval;
  1595. + }
  1596. +
  1597. + case FBIOCONDECOR_SETSTATE32:
  1598. + {
  1599. + compat_uint_t state_compat = 0;
  1600. + unsigned int state = 0;
  1601. +
  1602. + if (get_user(state_compat, (compat_uint_t __user *)data))
  1603. + return -EFAULT;
  1604. +
  1605. + state = (unsigned int)state_compat;
  1606. +
  1607. + return fbcon_decor_ioctl_dosetstate(vc, state, origin);
  1608. + }
  1609. +
  1610. + case FBIOCONDECOR_GETSTATE32:
  1611. + {
  1612. + compat_uint_t state_compat = 0;
  1613. + unsigned int state = 0;
  1614. +
  1615. + fbcon_decor_ioctl_dogetstate(vc, &state);
  1616. + state_compat = (compat_uint_t)state;
  1617. +
  1618. + return put_user(state_compat, (compat_uint_t __user *)data);
  1619. + }
  1620. +
  1621. + default:
  1622. + return -ENOIOCTLCMD;
  1623. + }
  1624. +}
  1625. +#else
  1626. + #define fbcon_decor_compat_ioctl NULL
  1627. +#endif
  1628. +
  1629. +static struct file_operations fbcon_decor_ops = {
  1630. + .owner = THIS_MODULE,
  1631. + .unlocked_ioctl = fbcon_decor_ioctl,
  1632. + .compat_ioctl = fbcon_decor_compat_ioctl
  1633. +};
  1634. +
  1635. +static struct miscdevice fbcon_decor_dev = {
  1636. + .minor = MISC_DYNAMIC_MINOR,
  1637. + .name = "fbcondecor",
  1638. + .fops = &fbcon_decor_ops
  1639. +};
  1640. +
  1641. +void fbcon_decor_reset()
  1642. +{
  1643. + int i;
  1644. +
  1645. + for (i = 0; i < num_registered_fb; i++) {
  1646. + registered_fb[i]->bgdecor.data = NULL;
  1647. + registered_fb[i]->bgdecor.cmap.red = NULL;
  1648. + }
  1649. +
  1650. + for (i = 0; i < MAX_NR_CONSOLES && vc_cons[i].d; i++) {
  1651. + vc_cons[i].d->vc_decor.state = vc_cons[i].d->vc_decor.twidth =
  1652. + vc_cons[i].d->vc_decor.theight = 0;
  1653. + vc_cons[i].d->vc_decor.theme = NULL;
  1654. + }
  1655. +
  1656. + return;
  1657. +}
  1658. +
  1659. +int fbcon_decor_init()
  1660. +{
  1661. + int i;
  1662. +
  1663. + fbcon_decor_reset();
  1664. +
  1665. + if (initialized)
  1666. + return 0;
  1667. +
  1668. + i = misc_register(&fbcon_decor_dev);
  1669. + if (i) {
  1670. + printk(KERN_ERR "fbcondecor: failed to register device\n");
  1671. + return i;
  1672. + }
  1673. +
  1674. + fbcon_decor_call_helper("init", 0);
  1675. + initialized = 1;
  1676. + return 0;
  1677. +}
  1678. +
  1679. +int fbcon_decor_exit(void)
  1680. +{
  1681. + fbcon_decor_reset();
  1682. + return 0;
  1683. +}
  1684. +
  1685. +EXPORT_SYMBOL(fbcon_decor_path);
  1686. diff -Nur linux-3.13.7.orig/drivers/video/console/fbcondecor.h linux-3.13.7/drivers/video/console/fbcondecor.h
  1687. --- linux-3.13.7.orig/drivers/video/console/fbcondecor.h 1970-01-01 01:00:00.000000000 +0100
  1688. +++ linux-3.13.7/drivers/video/console/fbcondecor.h 2014-03-29 21:17:27.000000000 +0100
  1689. @@ -0,0 +1,79 @@
  1690. +/*
  1691. + * linux/drivers/video/console/fbcondecor.h -- Framebuffer Console Decoration headers
  1692. + *
  1693. + * Copyright (C) 2004 Michal Januszewski <michalj+fbcondecor@gmail.com>
  1694. + *
  1695. + */
  1696. +
  1697. +#ifndef __FBCON_DECOR_H
  1698. +#define __FBCON_DECOR_H
  1699. +
  1700. +#ifndef _LINUX_FB_H
  1701. +#include <linux/fb.h>
  1702. +#endif
  1703. +
  1704. +/* This is needed for vc_cons in fbcmap.c */
  1705. +#include <linux/vt_kern.h>
  1706. +
  1707. +struct fb_cursor;
  1708. +struct fb_info;
  1709. +struct vc_data;
  1710. +
  1711. +#ifdef CONFIG_FB_CON_DECOR
  1712. +/* fbcondecor.c */
  1713. +int fbcon_decor_init(void);
  1714. +void fbcon_decor_reset(void);
  1715. +int fbcon_decor_exit(void);
  1716. +int fbcon_decor_call_helper(char* cmd, unsigned short cons);
  1717. +int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw);
  1718. +
  1719. +/* cfbcondecor.c */
  1720. +void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx);
  1721. +void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor);
  1722. +void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width);
  1723. +void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only);
  1724. +void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank);
  1725. +void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width);
  1726. +void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes, int srclinesbytes, int bpp);
  1727. +void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc);
  1728. +
  1729. +/* vt.c */
  1730. +void acquire_console_sem(void);
  1731. +void release_console_sem(void);
  1732. +void do_unblank_screen(int entering_gfx);
  1733. +
  1734. +/* struct vc_data *y */
  1735. +#define fbcon_decor_active_vc(y) (y->vc_decor.state && y->vc_decor.theme)
  1736. +
  1737. +/* struct fb_info *x, struct vc_data *y */
  1738. +#define fbcon_decor_active_nores(x,y) (x->bgdecor.data && fbcon_decor_active_vc(y))
  1739. +
  1740. +/* struct fb_info *x, struct vc_data *y */
  1741. +#define fbcon_decor_active(x,y) (fbcon_decor_active_nores(x,y) && \
  1742. + x->bgdecor.width == x->var.xres && \
  1743. + x->bgdecor.height == x->var.yres && \
  1744. + x->bgdecor.depth == x->var.bits_per_pixel)
  1745. +
  1746. +
  1747. +#else /* CONFIG_FB_CON_DECOR */
  1748. +
  1749. +static inline void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx) {}
  1750. +static inline void fbcon_decor_putc(struct vc_data *vc, struct fb_info *info, int c, int ypos, int xpos) {}
  1751. +static inline void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor) {}
  1752. +static inline void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) {}
  1753. +static inline void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only) {}
  1754. +static inline void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank) {}
  1755. +static inline void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width) {}
  1756. +static inline void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc) {}
  1757. +static inline int fbcon_decor_call_helper(char* cmd, unsigned short cons) { return 0; }
  1758. +static inline int fbcon_decor_init(void) { return 0; }
  1759. +static inline int fbcon_decor_exit(void) { return 0; }
  1760. +static inline int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw) { return 0; }
  1761. +
  1762. +#define fbcon_decor_active_vc(y) (0)
  1763. +#define fbcon_decor_active_nores(x,y) (0)
  1764. +#define fbcon_decor_active(x,y) (0)
  1765. +
  1766. +#endif /* CONFIG_FB_CON_DECOR */
  1767. +
  1768. +#endif /* __FBCON_DECOR_H */
  1769. diff -Nur linux-3.13.7.orig/drivers/video/fbcmap.c linux-3.13.7/drivers/video/fbcmap.c
  1770. --- linux-3.13.7.orig/drivers/video/fbcmap.c 2014-03-24 05:45:42.000000000 +0100
  1771. +++ linux-3.13.7/drivers/video/fbcmap.c 2014-03-29 16:03:17.000000000 +0100
  1772. @@ -17,6 +17,8 @@
  1773. #include <linux/slab.h>
  1774. #include <linux/uaccess.h>
  1775. +#include "console/fbcondecor.h"
  1776. +
  1777. static u16 red2[] __read_mostly = {
  1778. 0x0000, 0xaaaa
  1779. };
  1780. @@ -249,14 +251,17 @@
  1781. if (transp)
  1782. htransp = *transp++;
  1783. if (info->fbops->fb_setcolreg(start++,
  1784. - hred, hgreen, hblue,
  1785. + hred, hgreen, hblue,
  1786. htransp, info))
  1787. break;
  1788. }
  1789. }
  1790. - if (rc == 0)
  1791. + if (rc == 0) {
  1792. fb_copy_cmap(cmap, &info->cmap);
  1793. -
  1794. + if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
  1795. + info->fix.visual == FB_VISUAL_DIRECTCOLOR)
  1796. + fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
  1797. + }
  1798. return rc;
  1799. }
  1800. diff -Nur linux-3.13.7.orig/drivers/video/fbmem.c linux-3.13.7/drivers/video/fbmem.c
  1801. --- linux-3.13.7.orig/drivers/video/fbmem.c 2014-03-24 05:45:42.000000000 +0100
  1802. +++ linux-3.13.7/drivers/video/fbmem.c 2014-03-29 16:03:17.000000000 +0100
  1803. @@ -1250,15 +1250,6 @@
  1804. u16 reserved[3];
  1805. };
  1806. -struct fb_cmap32 {
  1807. - u32 start;
  1808. - u32 len;
  1809. - compat_caddr_t red;
  1810. - compat_caddr_t green;
  1811. - compat_caddr_t blue;
  1812. - compat_caddr_t transp;
  1813. -};
  1814. -
  1815. static int fb_getput_cmap(struct fb_info *info, unsigned int cmd,
  1816. unsigned long arg)
  1817. {
  1818. diff -Nur linux-3.13.7.orig/include/linux/console_decor.h linux-3.13.7/include/linux/console_decor.h
  1819. --- linux-3.13.7.orig/include/linux/console_decor.h 1970-01-01 01:00:00.000000000 +0100
  1820. +++ linux-3.13.7/include/linux/console_decor.h 2014-03-29 16:03:17.000000000 +0100
  1821. @@ -0,0 +1,46 @@
  1822. +#ifndef _LINUX_CONSOLE_DECOR_H_
  1823. +#define _LINUX_CONSOLE_DECOR_H_ 1
  1824. +
  1825. +/* A structure used by the framebuffer console decorations (drivers/video/console/fbcondecor.c) */
  1826. +struct vc_decor {
  1827. + __u8 bg_color; /* The color that is to be treated as transparent */
  1828. + __u8 state; /* Current decor state: 0 = off, 1 = on */
  1829. + __u16 tx, ty; /* Top left corner coordinates of the text field */
  1830. + __u16 twidth, theight; /* Width and height of the text field */
  1831. + char* theme;
  1832. +};
  1833. +
  1834. +#ifdef __KERNEL__
  1835. +#ifdef CONFIG_COMPAT
  1836. +#include <linux/compat.h>
  1837. +
  1838. +struct vc_decor32 {
  1839. + __u8 bg_color; /* The color that is to be treated as transparent */
  1840. + __u8 state; /* Current decor state: 0 = off, 1 = on */
  1841. + __u16 tx, ty; /* Top left corner coordinates of the text field */
  1842. + __u16 twidth, theight; /* Width and height of the text field */
  1843. + compat_uptr_t theme;
  1844. +};
  1845. +
  1846. +#define vc_decor_from_compat(to, from) \
  1847. + (to).bg_color = (from).bg_color; \
  1848. + (to).state = (from).state; \
  1849. + (to).tx = (from).tx; \
  1850. + (to).ty = (from).ty; \
  1851. + (to).twidth = (from).twidth; \
  1852. + (to).theight = (from).theight; \
  1853. + (to).theme = compat_ptr((from).theme)
  1854. +
  1855. +#define vc_decor_to_compat(to, from) \
  1856. + (to).bg_color = (from).bg_color; \
  1857. + (to).state = (from).state; \
  1858. + (to).tx = (from).tx; \
  1859. + (to).ty = (from).ty; \
  1860. + (to).twidth = (from).twidth; \
  1861. + (to).theight = (from).theight; \
  1862. + (to).theme = ptr_to_compat((from).theme)
  1863. +
  1864. +#endif /* CONFIG_COMPAT */
  1865. +#endif /* __KERNEL__ */
  1866. +
  1867. +#endif
  1868. diff -Nur linux-3.13.7.orig/include/linux/console_struct.h linux-3.13.7/include/linux/console_struct.h
  1869. --- linux-3.13.7.orig/include/linux/console_struct.h 2014-03-24 05:45:42.000000000 +0100
  1870. +++ linux-3.13.7/include/linux/console_struct.h 2014-03-29 16:03:17.000000000 +0100
  1871. @@ -19,6 +19,7 @@
  1872. struct vt_struct;
  1873. #define NPAR 16
  1874. +#include <linux/console_decor.h>
  1875. struct vc_data {
  1876. struct tty_port port; /* Upper level data */
  1877. @@ -107,6 +108,8 @@
  1878. unsigned long vc_uni_pagedir;
  1879. unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
  1880. bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */
  1881. +
  1882. + struct vc_decor vc_decor;
  1883. /* additional information is in vt_kern.h */
  1884. };
  1885. diff -Nur linux-3.13.7.orig/include/linux/fb.h linux-3.13.7/include/linux/fb.h
  1886. --- linux-3.13.7.orig/include/linux/fb.h 2014-03-24 05:45:42.000000000 +0100
  1887. +++ linux-3.13.7/include/linux/fb.h 2014-03-29 16:03:17.000000000 +0100
  1888. @@ -219,6 +219,34 @@
  1889. };
  1890. #endif
  1891. +#ifdef __KERNEL__
  1892. +#ifdef CONFIG_COMPAT
  1893. +struct fb_image32 {
  1894. + __u32 dx; /* Where to place image */
  1895. + __u32 dy;
  1896. + __u32 width; /* Size of image */
  1897. + __u32 height;
  1898. + __u32 fg_color; /* Only used when a mono bitmap */
  1899. + __u32 bg_color;
  1900. + __u8 depth; /* Depth of the image */
  1901. + const compat_uptr_t data; /* Pointer to image data */
  1902. + struct fb_cmap32 cmap; /* color map info */
  1903. +};
  1904. +
  1905. +#define fb_image_from_compat(to, from) \
  1906. + (to).dx = (from).dx; \
  1907. + (to).dy = (from).dy; \
  1908. + (to).width = (from).width; \
  1909. + (to).height = (from).height; \
  1910. + (to).fg_color = (from).fg_color; \
  1911. + (to).bg_color = (from).bg_color; \
  1912. + (to).depth = (from).depth; \
  1913. + (to).data = compat_ptr((from).data); \
  1914. + fb_cmap_from_compat((to).cmap, (from).cmap)
  1915. +
  1916. +#endif /* CONFIG_COMPAT */
  1917. +#endif /* __KERNEL__ */
  1918. +
  1919. /*
  1920. * Frame buffer operations
  1921. *
  1922. @@ -489,6 +517,9 @@
  1923. #define FBINFO_STATE_SUSPENDED 1
  1924. u32 state; /* Hardware state i.e suspend */
  1925. void *fbcon_par; /* fbcon use-only private area */
  1926. +
  1927. + struct fb_image bgdecor;
  1928. +
  1929. /* From here on everything is device dependent */
  1930. void *par;
  1931. /* we need the PCI or similar aperture base/size not
  1932. diff -Nur linux-3.13.7.orig/include/uapi/linux/fb.h linux-3.13.7/include/uapi/linux/fb.h
  1933. --- linux-3.13.7.orig/include/uapi/linux/fb.h 2014-03-24 05:45:42.000000000 +0100
  1934. +++ linux-3.13.7/include/uapi/linux/fb.h 2014-03-29 16:03:17.000000000 +0100
  1935. @@ -8,6 +8,25 @@
  1936. #define FB_MAX 32 /* sufficient for now */
  1937. +struct fbcon_decor_iowrapper
  1938. +{
  1939. + unsigned short vc; /* Virtual console */
  1940. + unsigned char origin; /* Point of origin of the request */
  1941. + void *data;
  1942. +};
  1943. +
  1944. +#ifdef __KERNEL__
  1945. +#ifdef CONFIG_COMPAT
  1946. +#include <linux/compat.h>
  1947. +struct fbcon_decor_iowrapper32
  1948. +{
  1949. + unsigned short vc; /* Virtual console */
  1950. + unsigned char origin; /* Point of origin of the request */
  1951. + compat_uptr_t data;
  1952. +};
  1953. +#endif /* CONFIG_COMPAT */
  1954. +#endif /* __KERNEL__ */
  1955. +
  1956. /* ioctls
  1957. 0x46 is 'F' */
  1958. #define FBIOGET_VSCREENINFO 0x4600
  1959. @@ -35,6 +54,25 @@
  1960. #define FBIOGET_DISPINFO 0x4618
  1961. #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
  1962. +#define FBIOCONDECOR_SETCFG _IOWR('F', 0x19, struct fbcon_decor_iowrapper)
  1963. +#define FBIOCONDECOR_GETCFG _IOR('F', 0x1A, struct fbcon_decor_iowrapper)
  1964. +#define FBIOCONDECOR_SETSTATE _IOWR('F', 0x1B, struct fbcon_decor_iowrapper)
  1965. +#define FBIOCONDECOR_GETSTATE _IOR('F', 0x1C, struct fbcon_decor_iowrapper)
  1966. +#define FBIOCONDECOR_SETPIC _IOWR('F', 0x1D, struct fbcon_decor_iowrapper)
  1967. +#ifdef __KERNEL__
  1968. +#ifdef CONFIG_COMPAT
  1969. +#define FBIOCONDECOR_SETCFG32 _IOWR('F', 0x19, struct fbcon_decor_iowrapper32)
  1970. +#define FBIOCONDECOR_GETCFG32 _IOR('F', 0x1A, struct fbcon_decor_iowrapper32)
  1971. +#define FBIOCONDECOR_SETSTATE32 _IOWR('F', 0x1B, struct fbcon_decor_iowrapper32)
  1972. +#define FBIOCONDECOR_GETSTATE32 _IOR('F', 0x1C, struct fbcon_decor_iowrapper32)
  1973. +#define FBIOCONDECOR_SETPIC32 _IOWR('F', 0x1D, struct fbcon_decor_iowrapper32)
  1974. +#endif /* CONFIG_COMPAT */
  1975. +#endif /* __KERNEL__ */
  1976. +
  1977. +#define FBCON_DECOR_THEME_LEN 128 /* Maximum lenght of a theme name */
  1978. +#define FBCON_DECOR_IO_ORIG_KERNEL 0 /* Kernel ioctl origin */
  1979. +#define FBCON_DECOR_IO_ORIG_USER 1 /* User ioctl origin */
  1980. +
  1981. #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
  1982. #define FB_TYPE_PLANES 1 /* Non interleaved planes */
  1983. #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
  1984. @@ -277,6 +315,29 @@
  1985. __u32 reserved[4]; /* Reserved for future compatibility */
  1986. };
  1987. +#ifdef __KERNEL__
  1988. +#ifdef CONFIG_COMPAT
  1989. +struct fb_cmap32 {
  1990. + __u32 start;
  1991. + __u32 len; /* Number of entries */
  1992. + compat_uptr_t red; /* Red values */
  1993. + compat_uptr_t green;
  1994. + compat_uptr_t blue;
  1995. + compat_uptr_t transp; /* transparency, can be NULL */
  1996. +};
  1997. +
  1998. +#define fb_cmap_from_compat(to, from) \
  1999. + (to).start = (from).start; \
  2000. + (to).len = (from).len; \
  2001. + (to).red = compat_ptr((from).red); \
  2002. + (to).green = compat_ptr((from).green); \
  2003. + (to).blue = compat_ptr((from).blue); \
  2004. + (to).transp = compat_ptr((from).transp)
  2005. +
  2006. +#endif /* CONFIG_COMPAT */
  2007. +#endif /* __KERNEL__ */
  2008. +
  2009. +
  2010. struct fb_cmap {
  2011. __u32 start; /* First entry */
  2012. __u32 len; /* Number of entries */
  2013. diff -Nur linux-3.13.7.orig/kernel/sysctl.c linux-3.13.7/kernel/sysctl.c
  2014. --- linux-3.13.7.orig/kernel/sysctl.c 2014-03-24 05:45:42.000000000 +0100
  2015. +++ linux-3.13.7/kernel/sysctl.c 2014-03-29 16:03:17.000000000 +0100
  2016. @@ -143,6 +143,10 @@
  2017. static int ngroups_max = NGROUPS_MAX;
  2018. static const int cap_last_cap = CAP_LAST_CAP;
  2019. +#ifdef CONFIG_FB_CON_DECOR
  2020. +extern char fbcon_decor_path[];
  2021. +#endif
  2022. +
  2023. #ifdef CONFIG_INOTIFY_USER
  2024. #include <linux/inotify.h>
  2025. #endif
  2026. @@ -252,6 +256,15 @@
  2027. .mode = 0555,
  2028. .child = dev_table,
  2029. },
  2030. +#ifdef CONFIG_FB_CON_DECOR
  2031. + {
  2032. + .procname = "fbcondecor",
  2033. + .data = &fbcon_decor_path,
  2034. + .maxlen = KMOD_PATH_LEN,
  2035. + .mode = 0644,
  2036. + .proc_handler = &proc_dostring,
  2037. + },
  2038. +#endif
  2039. { }
  2040. };