1 /*
2  * $Workfile: $
3  * $Revision: 1.16 $
4  *
5  * File Contents: This file contains the main functions of the NSC DFB.
6  *
7  * Project:       NSC Direct Frame buffer device driver
8  *
9  */
10 
11 /* NSC_LIC_ALTERNATIVE_PREAMBLE
12  *
13  * Revision 1.0
14  *
15  * National Semiconductor Alternative GPL-BSD License
16  *
17  * National Semiconductor Corporation licenses this software
18  * ("Software"):
19  *
20  * National Xfree frame buffer driver
21  *
22  * under one of the two following licenses, depending on how the
23  * Software is received by the Licensee.
24  *
25  * If this Software is received as part of the Linux Framebuffer or
26  * other GPL licensed software, then the GPL license designated
27  * NSC_LIC_GPL applies to this Software; in all other circumstances
28  * then the BSD-style license designated NSC_LIC_BSD shall apply.
29  *
30  * END_NSC_LIC_ALTERNATIVE_PREAMBLE */
31 
32 /* NSC_LIC_BSD
33  *
34  * National Semiconductor Corporation Open Source License for
35  *
36  * National Xfree frame buffer driver
37  *
38  * (BSD License with Export Notice)
39  *
40  * Copyright (c) 1999-2001
41  * National Semiconductor Corporation.
42  * All rights reserved.
43  *
44  * Redistribution and use in source and binary forms, with or without
45  * modification, are permitted provided that the following conditions
46  * are met:
47  *
48  *   * Redistributions of source code must retain the above copyright
49  *     notice, this list of conditions and the following disclaimer.
50  *
51  *   * Redistributions in binary form must reproduce the above
52  *     copyright notice, this list of conditions and the following
53  *     disclaimer in the documentation and/or other materials provided
54  *     with the distribution.
55  *
56  *   * Neither the name of the National Semiconductor Corporation nor
57  *     the names of its contributors may be used to endorse or promote
58  *     products derived from this software without specific prior
59  *     written permission.
60  *
61  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
62  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
63  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
64  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
65  * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
66  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
68  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
69  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
70  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
71  * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
72  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
73  * OF SUCH DAMAGE.
74  *
75  * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
76  * YOUR JURISDICTION. It is licensee's responsibility to comply with
77  * any export regulations applicable in licensee's jurisdiction. Under
78  * CURRENT (2001) U.S. export regulations this software
79  * is eligible for export from the U.S. and can be downloaded by or
80  * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
81  * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
82  * Syria, Sudan, Afghanistan and any other country to which the U.S.
83  * has embargoed goods and services.
84  *
85  * END_NSC_LIC_BSD */
86 
87 /* NSC_LIC_GPL
88  *
89  * National Semiconductor Corporation Gnu General Public License for
90  *
91  * National Xfree frame buffer driver
92  *
93  * (GPL License with Export Notice)
94  *
95  * Copyright (c) 1999-2001
96  * National Semiconductor Corporation.
97  * All rights reserved.
98  *
99  * Redistribution and use in source and binary forms, with or without
100  * modification, are permitted under the terms of the GNU General
101  * Public License as published by the Free Software Foundation; either
102  * version 2 of the License, or (at your option) any later version
103  *
104  * In addition to the terms of the GNU General Public License, neither
105  * the name of the National Semiconductor Corporation nor the names of
106  * its contributors may be used to endorse or promote products derived
107  * from this software without specific prior written permission.
108  *
109  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
110  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
111  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
112  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
113  * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
114  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
115  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
116  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
117  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
118  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
119  * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
120  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
121  * OF SUCH DAMAGE. See the GNU General Public License for more details.
122  *
123  * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
124  * YOUR JURISDICTION. It is licensee's responsibility to comply with
125  * any export regulations applicable in licensee's jurisdiction. Under
126  * CURRENT (2001) U.S. export regulations this software
127  * is eligible for export from the U.S. and can be downloaded by or
128  * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
129  * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
130  * Syria, Sudan, Afghanistan and any other country to which the U.S.
131  * has embargoed goods and services.
132  *
133  * You should have received a copy of the GNU General Public License
134  * along with this file; if not, write to the Free Software Foundation,
135  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
136  *
137  * END_NSC_LIC_GPL */
138 
139 #include <config.h>
140 
141 #include <dfb_types.h>
142 #include <stdio.h>
143 #include <unistd.h>
144 #include <stdlib.h>
145 #include <sys/mman.h>
146 #include <fcntl.h>
147 #include <sys/ioctl.h>
148 #include <malloc.h>
149 #include <directfb.h>
150 #include <core/coredefs.h>
151 #include <core/coretypes.h>
152 #include <core/state.h>
153 #include <core/gfxcard.h>
154 #include <core/surface.h>
155 #include <gfx/convert.h>
156 #include <gfx/util.h>
157 #include <misc/conf.h>
158 #include <misc/util.h>
159 #include <core/graphics_driver.h>
160 #include <direct/messages.h>
161 #include <direct/util.h>
162 
163 #include "nsc_galproto.h"
164 
165 #define NSC_ACCEL 1
166 
167 #define GP_VECTOR_DEST_DATA       0x8
168 #define GP_VECTOR_MINOR_AXIS_POS  0x4
169 #define GP_VECTOR_MAJOR_AXIS_POS  0x2
170 #define GP_VECTOR_Y_MAJOR         0x1
171 
172 #define  GFX_CPU_REDCLOUD 3
173 
174 #define GX_SUPPORTED_DRAWINGFLAGS DSDRAW_NOFX
175 
176 #define GX_SUPPORTED_DRAWINGFUNCTIONS \
177                (DFXL_FILLRECTANGLE | \
178                 DFXL_DRAWRECTANGLE | \
179                 DFXL_DRAWLINE)
180 
181 #define GX_SUPPORTED_BLITTINGFUNCTIONS DFXL_BLIT
182 
183 #define GX_SUPPORTED_BLITTINGFLAGS DSBLIT_SRC_COLORKEY
184 
185 DFB_GRAPHICS_DRIVER(nsc)
186 
187 typedef struct
188 {
189   unsigned long Color;
190   unsigned long src_offset;
191   unsigned long dst_offset;
192   unsigned long src_pitch;
193   unsigned long dst_pitch;
194   unsigned long src_colorkey;
195   int v_srcColorkey;
196 }NSCDeviceData;
197 
198 typedef struct
199 {
200   unsigned int cpu_version;
201   int cpu;
202 }NSCDriverData;
203 
204 static GAL_ADAPTERINFO sAdapterInfo;
205 
206 static bool nscDrawLine(void *drv, void *dev, DFBRegion *line);
207 static bool nscFillRectangle(void *drv, void *dev, DFBRectangle *rect);
208 static bool nscDrawRectangle(void *drv, void *dev, DFBRectangle *rect);
209 static bool nscBlit(void *drv, void *dev, DFBRectangle *rect, int dx, int dy);
210 static bool nscBlitGu1(void *drv, void *dev, DFBRectangle *rect, int dx, int dy);
211 
gxEngineSync(void * drv,void * dev)212 static DFBResult gxEngineSync(void *drv, void *dev)
213 {
214    Gal_wait_until_idle();
215 
216    return DFB_OK;
217 }
218 
219 static inline void
nsc_validate_srcColorkey(NSCDriverData * gxdrv,NSCDeviceData * gxdev,CardState * state)220 nsc_validate_srcColorkey(NSCDriverData *gxdrv,
221                          NSCDeviceData *gxdev, CardState *state)
222 {
223    if (gxdev->v_srcColorkey)
224       return;
225    gxdev->src_colorkey = state->src_colorkey;
226    gxdev->v_srcColorkey = 1;
227 }
228 
229 static void
gxCheckState(void * drv,void * dev,CardState * state,DFBAccelerationMask accel)230 gxCheckState(void *drv,
231              void *dev, CardState *state, DFBAccelerationMask accel)
232 {
233 #if NSC_ACCEL
234    NSCDriverData *gxdrv = (NSCDriverData *) drv;
235    NSCDeviceData *gxdev = (NSCDeviceData *) dev;
236 
237    if(state->destination->config.format != DSPF_RGB16)
238       return;
239 
240    if (DFB_BLITTING_FUNCTION(accel)) {
241 
242 	   if(state->source->config.format != DSPF_RGB16)
243 		  return;
244       if (gxdrv->cpu) {
245          /* GU2 - if there are no other blitting flags than the supported
246           * and the source and destination formats are the same
247           */
248          if (!(state->blittingflags & ~GX_SUPPORTED_BLITTINGFLAGS) &&
249              state->source && state->source->config.format != DSPF_RGB24) {
250             state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS;
251          }
252       } else{
253          /* GU1 - source width must match frame buffer strid
254           */
255          if(state->source) {
256             int src_pitch = 0;
257             int dst_pitch = 0;
258 
259             if(state->source) {
260                src_pitch = state->source->config.size.w * DFB_BYTES_PER_PIXEL(state->source->config.format);
261             }
262 
263             if (state->modified & SMF_DESTINATION) {
264                if(state->destination && state->dst.buffer)
265                   dst_pitch = state->dst.pitch;
266             }
267             if(dst_pitch == 0) {
268                dst_pitch = gxdev->dst_pitch;
269             }
270 
271             if(src_pitch == dst_pitch && state->source) {
272                state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS;
273             }
274          }
275       }
276    } else {
277       /* if there are no other drawing flags than the supported */
278       if (!(state->drawingflags & ~GX_SUPPORTED_DRAWINGFLAGS)) {
279          state->accel |= GX_SUPPORTED_DRAWINGFUNCTIONS;
280       }
281    }
282 #endif /* NSC_ACCEL */
283 }
284 
285 static void
gxSetState(void * drv,void * dev,GraphicsDeviceFuncs * funcs,CardState * state,DFBAccelerationMask accel)286 gxSetState(void *drv, void *dev,
287            GraphicsDeviceFuncs *funcs,
288            CardState *state, DFBAccelerationMask accel)
289 {
290    NSCDriverData *gxdrv = (NSCDriverData *) drv;
291    NSCDeviceData *gxdev = (NSCDeviceData *) dev;
292 
293    if (state->mod_hw & SMF_SRC_COLORKEY)
294       gxdev->v_srcColorkey = 0;
295 
296    switch (accel) {
297    case DFXL_BLIT:
298          state->set |= DFXL_BLIT;
299          if (state->blittingflags & DSBLIT_SRC_COLORKEY)
300             nsc_validate_srcColorkey(gxdrv, gxdev, state);
301          break;
302 
303    case DFXL_FILLRECTANGLE:
304    case DFXL_DRAWRECTANGLE:
305    case DFXL_DRAWLINE:
306       state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWLINE | DFXL_DRAWRECTANGLE;
307       break;
308 
309    default:
310       D_BUG("unexpected drawing/blitting function");
311       break;
312    }
313 
314    if (state->mod_hw & SMF_DESTINATION) {
315 
316       /* set offset & pitch */
317 
318       gxdev->dst_offset = state->dst.offset;
319       gxdev->dst_pitch = state->dst.pitch;
320    }
321 
322    if (state->mod_hw & SMF_SOURCE && state->source) {
323 
324       gxdev->src_offset = state->src.offset;
325       gxdev->src_pitch = state->src.pitch;
326    }
327 
328    if (state->mod_hw & (SMF_DESTINATION | SMF_COLOR)) {
329       switch (state->destination->config.format) {
330       case DSPF_A8:
331          gxdev->Color = state->color.a;
332          break;
333       case DSPF_ARGB1555:
334          gxdev->Color =
335                PIXEL_ARGB1555(state->color.a, state->color.r,
336                               state->color.g, state->color.b);
337          break;
338       case DSPF_RGB16:
339          gxdev->Color =
340                PIXEL_RGB16(state->color.r, state->color.g, state->color.b);
341          break;
342 
343       default:
344          D_BUG("unexpected pixelformat");
345          break;
346       }
347    }
348 
349    state->mod_hw = 0;
350 }
351 
352 static bool
nscDrawLine(void * drv,void * dev,DFBRegion * line)353 nscDrawLine(void *drv, void *dev, DFBRegion *line)
354 {
355    long dx, dy, adx, ady;
356    short majorErr;
357    unsigned short destData;
358    NSCDeviceData *gxdev = (NSCDeviceData *) dev;
359    int yoffset;
360 
361    destData = 0;                        /*  Value will be 0x8 (or) 0 */
362    dx = line->x2 - line->x1;            /*  delta values */
363    dy = line->y2 - line->y1;
364    adx = ABS(dx);
365    ady = ABS(dy);
366    yoffset = gxdev->dst_offset / gxdev->dst_pitch;
367 
368    /* Canonical Bresenham stepper.
369     * * We use hardware to draw the pixels to take care of alu modes
370     * * and whatnot.
371     */
372    Gal_set_raster_operation(0xF0);
373    Gal_set_solid_pattern(gxdev->Color);
374    if (adx >= ady) {
375       unsigned short vectorMode;
376 
377       vectorMode = destData;
378       if (dy >= 0)
379          vectorMode |= GP_VECTOR_MINOR_AXIS_POS;
380       if (dx >= 0)
381          vectorMode |= GP_VECTOR_MAJOR_AXIS_POS;
382       majorErr = (short)(ady << 1);
383 
384       Gal_bresenham_line((short)line->x1,
385                          (short)line->y1 + yoffset,
386                          (short)adx,
387                          (short)(majorErr - adx),
388                          (short)majorErr,
389                          (short)(majorErr - (adx << 1)), vectorMode);
390    } else {
391       unsigned short vectorMode;
392 
393       vectorMode = destData | GP_VECTOR_Y_MAJOR;
394 
395       if (dx >= 0)
396          vectorMode |= GP_VECTOR_MINOR_AXIS_POS;
397       if (dy >= 0)
398          vectorMode |= GP_VECTOR_MAJOR_AXIS_POS;
399       majorErr = (short)(adx << 1);
400       Gal_bresenham_line((short)line->x1,
401                          (short)line->y1 + yoffset,
402                          (short)ady,
403                          (short)(majorErr - ady),
404                          (short)majorErr,
405                          (short)(majorErr - (ady << 1)), vectorMode);
406    }
407 
408    return true;
409 }
410 
411 static bool
nscFillRectangle(void * drv,void * dev,DFBRectangle * rect)412 nscFillRectangle(void *drv, void *dev, DFBRectangle *rect)
413 {
414    NSCDeviceData *gxdev = (NSCDeviceData *) dev;
415    int yoffset;
416 
417    Gal_set_raster_operation(0xF0);
418    Gal_set_solid_pattern(gxdev->Color);
419 
420    yoffset = gxdev->dst_offset / gxdev->dst_pitch;
421    Gal_pattern_fill(rect->x, rect->y + yoffset, rect->w, rect->h);
422 
423    return true;
424 }
425 
426 static bool
nscDrawRectangle(void * drv,void * dev,DFBRectangle * rect)427 nscDrawRectangle(void *drv, void *dev, DFBRectangle *rect)
428 {
429    NSCDeviceData *gxdev = (NSCDeviceData *) dev;
430    int yoffset;
431 
432    Gal_set_raster_operation(0xF0);
433    Gal_set_solid_pattern(gxdev->Color);
434 
435    yoffset = gxdev->dst_offset / gxdev->dst_pitch;
436 
437    Gal_pattern_fill(rect->x, rect->y + yoffset, rect->w, 1);
438    Gal_pattern_fill(rect->x, ((rect->y + yoffset + rect->h) - 1), rect->w, 1);
439    Gal_pattern_fill(rect->x, (rect->y + yoffset + 1), 1, (rect->h - 2));
440    Gal_pattern_fill(((rect->x + rect->w) - 1),
441                     (rect->y + yoffset + 1), 1, (rect->h - 2));
442 
443    return true;
444 }
445 
446 static bool
nscBlit(void * drv,void * dev,DFBRectangle * rect,int dx,int dy)447 nscBlit(void *drv, void *dev, DFBRectangle * rect, int dx, int dy)
448 {
449    NSCDeviceData *nscdev = (NSCDeviceData *) dev;
450    unsigned long soffset = (rect->x * nscdev->src_pitch) + (rect->y * 2);
451    unsigned long doffset = (dy * nscdev->dst_pitch) + (dx * 2);
452 
453    Gal_set_solid_pattern(nscdev->Color);
454    if (nscdev->v_srcColorkey) {
455       Gal2_set_source_transparency(nscdev->src_colorkey, 0xFFFF);
456    }
457    Gal_set_raster_operation(0xCC);
458    Gal2_set_source_stride((unsigned short)nscdev->src_pitch);
459    Gal2_set_destination_stride(nscdev->dst_pitch);
460    Gal2_screen_to_screen_blt(nscdev->src_offset + soffset,
461                              nscdev->dst_offset + doffset,
462                              (unsigned short)rect->w,
463                              (unsigned short)rect->h, 1);
464 
465    return true;
466 }
467 
468 static bool
nscBlitGu1(void * drv,void * dev,DFBRectangle * rect,int dx,int dy)469 nscBlitGu1(void *drv, void *dev, DFBRectangle * rect, int dx, int dy)
470 {
471    int result, yoff;
472 
473    NSCDeviceData *nscdev = (NSCDeviceData *) dev;
474 
475    Gal_set_solid_pattern(nscdev->Color);
476    if (nscdev->v_srcColorkey) {
477 //FIXME     Gal_set_source_transparency(nscdev->src_colorkey, 0xFFFF);
478    }
479 #if 0
480    printf("rect x %d y %d w %d h %d dx %d dy %d src_off %x dst_off %x src pitch %x dst pitch %x\n",
481 		rect->x, rect->y, rect->w, rect->h, dx, dy,
482 		nscdev->src_offset, nscdev->dst_offset,
483 		nscdev->src_pitch, nscdev->dst_pitch);
484 #endif
485 
486    Gal_set_raster_operation(0xCC);
487 
488    yoff = nscdev->src_offset / nscdev->src_pitch;
489    result = Gal_screen_to_screen_blt(rect->x, rect->y + yoff, dx, dy,
490                              (unsigned short)rect->w,
491                              (unsigned short)rect->h);
492 
493    return true;
494 }
495 
496 /* exported symbols */
497 
498 static int
driver_probe(CoreGraphicsDevice * device)499 driver_probe(CoreGraphicsDevice *device)
500 {
501    Gal_initialize_interface();
502    if(!Gal_get_adapter_info(&sAdapterInfo))
503       return 0;
504 
505    return sAdapterInfo.dwFrameBufferBase == dfb_gfxcard_memory_physical( device, 0 );
506 }
507 
508 static void
driver_get_info(CoreGraphicsDevice * device,GraphicsDriverInfo * info)509 driver_get_info(CoreGraphicsDevice *device, GraphicsDriverInfo *info)
510 {
511    /* fill driver info structure */
512    snprintf(info->name,
513             DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "NSC GX1 and GX2 Driver");
514    snprintf(info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "NSC");
515 
516    info->version.major = 1;
517    info->version.minor = 1;
518    info->driver_data_size = sizeof(NSCDriverData);
519    info->device_data_size = sizeof(NSCDeviceData);
520 }
521 
522 static DFBResult
driver_init_driver(CoreGraphicsDevice * device,GraphicsDeviceFuncs * funcs,void * driver_data,void * device_data,CoreDFB * core)523 driver_init_driver(CoreGraphicsDevice  *device,
524                    GraphicsDeviceFuncs *funcs,
525                    void                *driver_data,
526                    void                *device_data,
527                    CoreDFB             *core)
528 {
529    NSCDriverData *gxdrv = (NSCDriverData *) driver_data;
530 
531    Gal_set_compression_enable(0);
532 
533    gxdrv->cpu_version = sAdapterInfo.dwCPUVersion;
534    gxdrv->cpu = 0;
535    if ((gxdrv->cpu_version & 0xFF) == GFX_CPU_REDCLOUD) {
536       gxdrv->cpu = 1;
537    }
538    D_DEBUG("CPU is GX%d", gxdrv->cpu);
539 
540 #if NSC_ACCEL
541    funcs->CheckState = gxCheckState;
542    funcs->SetState = gxSetState;
543    funcs->EngineSync = gxEngineSync;
544    funcs->FillRectangle = nscFillRectangle;
545    funcs->DrawLine = nscDrawLine;
546    funcs->DrawRectangle = nscDrawRectangle;
547    funcs->DrawLine = nscDrawLine;
548    if (gxdrv->cpu) {
549       funcs->Blit = nscBlit;
550    } else {
551       funcs->Blit = nscBlitGu1;
552    }
553 #endif /* NSC_ACCEL */
554 
555     /*dfb_config->pollvsync_after = 1;*/
556 
557    return DFB_OK;
558 }
559 
560 static DFBResult
driver_init_device(CoreGraphicsDevice * device,GraphicsDeviceInfo * device_info,void * driver_data,void * device_data)561 driver_init_device(CoreGraphicsDevice *device,
562                    GraphicsDeviceInfo *device_info,
563                    void *driver_data, void *device_data)
564 {
565    snprintf(device_info->name,
566             DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "NSC GX1/GX2 driver version");
567    snprintf(device_info->vendor,
568             DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "nsc");
569    printf("Dependent NSC Kernel FrameBuffer driver version is 2.7.7 or later\n");
570    device_info->caps.flags = CCF_NOTRIEMU;
571    device_info->caps.accel = GX_SUPPORTED_DRAWINGFUNCTIONS;
572    device_info->caps.drawing = GX_SUPPORTED_DRAWINGFLAGS;
573    device_info->caps.accel |= GX_SUPPORTED_BLITTINGFUNCTIONS;
574    device_info->caps.blitting = GX_SUPPORTED_BLITTINGFLAGS;
575    return DFB_OK;
576 }
577 
578 static void
driver_close_device(CoreGraphicsDevice * device,void * driver_data,void * device_data)579 driver_close_device(CoreGraphicsDevice * device,
580                     void *driver_data, void *device_data)
581 {
582    NSCDeviceData *gxdev = (NSCDeviceData *) device_data;
583 
584    (void)gxdev;
585    D_DEBUG("DirectFB/nsc: 5");
586 }
587 
588 static void
driver_close_driver(CoreGraphicsDevice * device,void * driver_data)589 driver_close_driver(CoreGraphicsDevice *device, void *driver_data)
590 {
591    D_DEBUG("DirectFB/nsc: 6");
592 }
593