<commit_before>#ifdef PXA3XX_DEBUG_DRIVER
#define DIRECT_ENABLE_DEBUG
#endif

#include <config.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

#include <sys/mman.h>
#include <fcntl.h>

#include <directfb.h>
#include <directfb_util.h>

#include <direct/debug.h>
#include <direct/messages.h>
#include <direct/system.h>

#include <misc/conf.h>

#include <core/core.h>
#include <core/gfxcard.h>
#include <core/layers.h>
#include <core/screens.h>
#include <core/system.h>

#include <core/graphics_driver.h>

DFB_GRAPHICS_DRIVER( pxa3xx )


#include "pxa3xx.h"
#include "pxa3xx_blt.h"


D_DEBUG_DOMAIN( PXA3XX_Driver, "PXA3XX/Driver", "Marvell PXA3XX Driver" );

/**********************************************************************************************************************/

static int
driver_probe( CoreGraphicsDevice *device )
{
     D_DEBUG_AT( PXA3XX_Driver, "%s()\n", __FUNCTION__ );

     return dfb_gfxcard_get_accelerator( device ) == 1234;  // FIXME
}

static void
driver_get_info( CoreGraphicsDevice *device,
                 GraphicsDriverInfo *info )
{
     D_DEBUG_AT( PXA3XX_Driver, "%s()\n", __FUNCTION__ );

     /* fill driver info structure */
     snprintf( info->name,
               DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH,
               "Marvell PXA3XX Driver" );

     snprintf( info->vendor,
               DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH,
               "Denis & <NAME>" );

     info->version.major = 0;
     info->version.minor = 3;

     info->driver_data_size = sizeof(PXA3XXDriverData);
     info->device_data_size = sizeof(PXA3XXDeviceData);
}

static DFBResult
driver_init_driver( CoreGraphicsDevice  *device,
                    GraphicsDeviceFuncs *funcs,
                    void                *driver_data,
                    void                *device_data,
                    CoreDFB             *core )
{
     PXA3XXDriverData *pdrv = driver_data;

     D_DEBUG_AT( PXA3XX_Driver, "%s()\n", __FUNCTION__ );

     /* Keep pointer to shared device data. */
     pdrv->dev = device_data;

     /* Keep core and device pointer. */
     pdrv->core   = core;
     pdrv->device = device;

     /* Open the drawing engine device. */
     pdrv->gfx_fd = direct_try_open( "/dev/pxa3xx_gfx", "/dev/misc/pxa3xx_gfx", O_RDWR, true );
     if (pdrv->gfx_fd < 0)
          return DFB_INIT;

     /* Map its shared data. */
     pdrv->gfx_shared = mmap( NULL, direct_page_align( sizeof(PXA3XXGfxSharedArea) ),<commit_msg>[pxa3xx] adjust the device name<commit_after>#ifdef PXA3XX_DEBUG_DRIVER
#define DIRECT_ENABLE_DEBUG
#endif

#include <config.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

#include <sys/mman.h>
#include <fcntl.h>

#include <directfb.h>
#include <directfb_util.h>

#include <direct/debug.h>
#include <direct/messages.h>
#include <direct/system.h>

#include <misc/conf.h>

#include <core/core.h>
#include <core/gfxcard.h>
#include <core/layers.h>
#include <core/screens.h>
#include <core/system.h>

#include <core/graphics_driver.h>

DFB_GRAPHICS_DRIVER( pxa3xx )


#include "pxa3xx.h"
#include "pxa3xx_blt.h"


D_DEBUG_DOMAIN( PXA3XX_Driver, "PXA3XX/Driver", "Marvell PXA3XX Driver" );

/**********************************************************************************************************************/

static int
driver_probe( CoreGraphicsDevice *device )
{
     D_DEBUG_AT( PXA3XX_Driver, "%s()\n", __FUNCTION__ );

     return dfb_gfxcard_get_accelerator( device ) == 1234;  // FIXME
}

static void
driver_get_info( CoreGraphicsDevice *device,
                 GraphicsDriverInfo *info )
{
     D_DEBUG_AT( PXA3XX_Driver, "%s()\n", __FUNCTION__ );

     /* fill driver info structure */
     snprintf( info->name,
               DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH,
               "Marvell PXA3XX Driver" );

     snprintf( info->vendor,
               DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH,
               "Denis & <NAME>" );

     info->version.major = 0;
     info->version.minor = 3;

     info->driver_data_size = sizeof(PXA3XXDriverData);
     info->device_data_size = sizeof(PXA3XXDeviceData);
}

static DFBResult
driver_init_driver( CoreGraphicsDevice  *device,
                    GraphicsDeviceFuncs *funcs,
                    void                *driver_data,
                    void                *device_data,
                    CoreDFB             *core )
{
     PXA3XXDriverData *pdrv = driver_data;

     D_DEBUG_AT( PXA3XX_Driver, "%s()\n", __FUNCTION__ );

     /* Keep pointer to shared device data. */
     pdrv->dev = device_data;

     /* Keep core and device pointer. */
     pdrv->core   = core;
     pdrv->device = device;

     /* Open the drawing engine device. */
     pdrv->gfx_fd = direct_try_open( "/dev/pxa3xx-gcu",
                                     "/dev/misc/pxa3xx-gcu", O_RDWR, true );
     if (pdrv->gfx_fd < 0)
          return DFB_INIT;

     /* Map its shared data. */
     pdrv->gfx_shared = mmap( NULL, direct_page_align( sizeof(PXA3XXGfxSharedArea) ),
{'fraction_non_alphanumeric': 0.16505810518022454, 'fraction_numerical': 0.009651368918652748, 'mean_word_length': 2.882262996941896, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7289299', 'n_tokens_mistral': 1818, 'n_tokens_neox': 1727, 'n_words': 338}