The LCDC is controlled by the kernel and nothing else should access
this. Removing this means that we lose the ability to display surfaces
allocated in dfb memory. However is makes this code simpler and less
dependant on the hardware.

Signed-off-by: Phil Edworthy <phil.edwor...@renesas.com>
---
 gfxdrivers/sh772x/Makefile.am    |    2 -
 gfxdrivers/sh772x/README.sh7722  |    1 -
 gfxdrivers/sh772x/sh7722.c       |   54 ------------
 gfxdrivers/sh772x/sh7722.h       |   21 -----
 gfxdrivers/sh772x/sh7722_layer.c |    1 -
 gfxdrivers/sh772x/sh7722_lcd.c   |  172 --------------------------------------
 gfxdrivers/sh772x/sh7722_lcd.h   |   17 ----
 gfxdrivers/sh772x/sh7722_regs.h  |   41 ---------
 8 files changed, 0 insertions(+), 309 deletions(-)
 delete mode 100644 gfxdrivers/sh772x/sh7722_lcd.c
 delete mode 100644 gfxdrivers/sh772x/sh7722_lcd.h

diff --git a/gfxdrivers/sh772x/Makefile.am b/gfxdrivers/sh772x/Makefile.am
index ccdedbc..0e5663d 100644
--- a/gfxdrivers/sh772x/Makefile.am
+++ b/gfxdrivers/sh772x/Makefile.am
@@ -40,8 +40,6 @@ libdirectfb_sh7722_la_SOURCES =       \
        sh7723_blt.h            \
        sh7722_layer.c          \
        sh7722_layer.h          \
-       sh7722_lcd.c            \
-       sh7722_lcd.h            \
        sh7722_multi.c          \
        sh7722_multi.h          \
        sh7722_regs.h           \
diff --git a/gfxdrivers/sh772x/README.sh7722 b/gfxdrivers/sh772x/README.sh7722
index 45bbf87..3c53e83 100644
--- a/gfxdrivers/sh772x/README.sh7722
+++ b/gfxdrivers/sh772x/README.sh7722
@@ -2,7 +2,6 @@ Renesas SH7722 graphics driver
 ==============================
 
 This driver supports the SH7722 SoC from Renesas Solutions Corp. controlling
-- LCDC (LCD Controller) for display
 - BEU (Blit Engine Unit) for blending of planes
 - TDG (2D Graphics) for accelerated operations
 
diff --git a/gfxdrivers/sh772x/sh7722.c b/gfxdrivers/sh772x/sh7722.c
index a038e09..47cece3 100644
--- a/gfxdrivers/sh772x/sh7722.c
+++ b/gfxdrivers/sh772x/sh7722.c
@@ -41,16 +41,13 @@ DFB_GRAPHICS_DRIVER( sh7722 )
 #include "sh7722.h"
 #include "sh7722_blt.h"
 #include "sh7722_layer.h"
-#include "sh7722_lcd.h"
 #include "sh7722_multi.h"
 #include "sh7722_screen.h"
 
 #include "sh7723_blt.h"
 
-#ifdef SH772X_FBDEV_SUPPORT
 #include <linux/fb.h>
 #include <sys/mman.h>
-#endif
 
 /* libshbeu */
 #include <shbeu/shbeu.h>
@@ -184,14 +181,6 @@ driver_init_driver( CoreGraphicsDevice  *device,
      }
 
 
-     /* Get virtual address for the LCD buffer in slaves here,
-        master does it in driver_init_device(). */
-#ifndef SH772X_FBDEV_SUPPORT
-     if (!dfb_core_is_master( core ))
-          sdrv->lcd_virt = dfb_gfxcard_memory_virtual( device, 
sdev->lcd_offset );
-#endif
-
-
      /* Register primary screen. */
      sdrv->screen = dfb_screens_register( device, driver_data, 
&sh7722ScreenFuncs );
 
@@ -236,7 +225,6 @@ driver_init_device( CoreGraphicsDevice *device,
      /*
       * Setup LCD buffer.
       */
-#ifdef SH772X_FBDEV_SUPPORT
      { 
          struct fb_fix_screeninfo fsi;
          struct fb_var_screeninfo vsi;
@@ -295,24 +283,6 @@ driver_init_device( CoreGraphicsDevice *device,
 
                  close(fbdev);
      }     
-#else
-     sdev->lcd_width  = SH7722_LCD_WIDTH;
-     sdev->lcd_height = SH7722_LCD_HEIGHT;
-     sdev->lcd_pitch  = (DFB_BYTES_PER_LINE( sdev->lcd_format, sdev->lcd_width 
) + 0xf) & ~0xf;
-     sdev->lcd_size   = DFB_PLANE_MULTIPLY( sdev->lcd_format, sdev->lcd_height 
) * sdev->lcd_pitch;
-     sdev->lcd_offset = dfb_gfxcard_reserve_memory( device, sdev->lcd_size );
-
-     if (sdev->lcd_offset < 0) {
-          D_ERROR( "SH7722/Driver: Allocating %d bytes for the LCD buffer 
failed!\n", sdev->lcd_size );
-          return DFB_FAILURE;
-     }
-
-     sdev->lcd_phys = dfb_gfxcard_memory_physical( device, sdev->lcd_offset );
-
-     /* Get virtual addresses for LCD buffer in master here,
-        slaves do it in driver_init_driver(). */
-     sdrv->lcd_virt = dfb_gfxcard_memory_virtual( device, sdev->lcd_offset );
-#endif
 
      D_INFO( "SH7722/LCD: Allocated %dx%d %s Buffer (%d bytes) at 0x%08lx 
(%p)\n",
              sdev->lcd_width, sdev->lcd_height, 
dfb_pixelformat_name(sdev->lcd_format),
@@ -378,24 +348,6 @@ driver_init_device( CoreGraphicsDevice *device,
                return DFB_BUG;
      }
 
-#ifndef SH772X_FBDEV_SUPPORT
-     /* Clear LCD buffer. */
-     switch (sdev->lcd_format) {
-          case DSPF_RGB16:
-               memset( (void*) sdrv->lcd_virt, 0x00, sdev->lcd_height * 
sdev->lcd_pitch );
-               break;
-
-          case DSPF_NV16:
-               memset( (void*) sdrv->lcd_virt, 0x10, sdev->lcd_height * 
sdev->lcd_pitch );
-               memset( (void*) sdrv->lcd_virt + sdev->lcd_height * 
sdev->lcd_pitch, 0x80, sdev->lcd_height * sdev->lcd_pitch );
-               break;
-
-          default:
-               D_BUG( "unsupported format" );
-               return DFB_BUG;
-     }
-#endif
-
      /*
       * TODO: Make LCD Buffer format and primary BEU format runtime 
configurable.
       */
@@ -419,12 +371,6 @@ driver_init_device( CoreGraphicsDevice *device,
                return DFB_BUG;
      }
 
-#ifndef SH772X_FBDEV_SUPPORT
-     /* Setup LCD controller to show the buffer. */
-     sh7722_lcd_setup( sdrv, sdev->lcd_width, sdev->lcd_height,
-                       sdev->lcd_phys, sdev->lcd_pitch, sdev->lcd_format, 
false );
-#endif
-
      /* Initialize BEU lock. */
      fusion_skirmish_init( &sdev->beu_lock, "BEU", dfb_core_world(sdrv->core) 
);
 
diff --git a/gfxdrivers/sh772x/sh7722.h b/gfxdrivers/sh772x/sh7722.h
index 0a80512..41636aa 100644
--- a/gfxdrivers/sh772x/sh7722.h
+++ b/gfxdrivers/sh772x/sh7722.h
@@ -9,30 +9,9 @@
 #include "sh7722_types.h"
 
 
-#define SH772X_FBDEV_SUPPORT
 // #define JPU_SUPPORT
 
 /******************************************************************************
- * Platform specific values (FIXME: add runtime config)
- */
-
-#define ALGO_AP325
-#undef  SH7722_ALGO_PANEL
-
-/* LCD Panel Configuration */
-#if defined(SH7722_ALGO_PANEL)
-#  define      SH7722_LCD_WIDTH        640
-#  define      SH7722_LCD_HEIGHT       480
-#elif defined(ALGO_AP325)
-#  define      SH7722_LCD_WIDTH        800
-#  define      SH7722_LCD_HEIGHT       480
-#else
-#  define      SH7722_LCD_WIDTH        800
-#  define      SH7722_LCD_HEIGHT       480
-#endif
-
-
-/******************************************************************************
  * Register access
  */
 
diff --git a/gfxdrivers/sh772x/sh7722_layer.c b/gfxdrivers/sh772x/sh7722_layer.c
index dae702a..4c817c9 100644
--- a/gfxdrivers/sh772x/sh7722_layer.c
+++ b/gfxdrivers/sh772x/sh7722_layer.c
@@ -35,7 +35,6 @@
 #include "sh7722.h"
 #include "sh7722_types.h"
 #include "sh7722_layer.h"
-#include "sh7722_lcd.h"
 
 
 D_DEBUG_DOMAIN( SH7722_Layer, "SH7722/Layer", "Renesas SH7722 Layers" );
diff --git a/gfxdrivers/sh772x/sh7722_lcd.c b/gfxdrivers/sh772x/sh7722_lcd.c
deleted file mode 100644
index 47df333..0000000
--- a/gfxdrivers/sh772x/sh7722_lcd.c
+++ /dev/null
@@ -1,172 +0,0 @@
-#ifdef SH7722_DEBUG_LCD
-#define DIRECT_ENABLE_DEBUG
-#endif
-
-
-#include <config.h>
-
-#include <asm/types.h>
-
-#include <direct/debug.h>
-
-#include <misc/conf.h>
-
-#include "sh7722.h"
-
-
-D_DEBUG_DOMAIN( SH7722_LCD, "SH7722/LCD", "Renesas SH7722 LCD" );
-
-/**********************************************************************************************************************/
-
-void
-sh7722_lcd_setup( void                  *drv,
-                  int                    width,
-                  int                    height,
-                  ulong                  phys,
-                  int                    pitch,
-                  DFBSurfacePixelFormat  format,
-                  bool                   swap )
-{
-     u32 MLDDFR = 0;
-     u32 LDDDSR = 0;
-     u32 reg;
-
-     D_DEBUG_AT( SH7722_LCD, "%s( %dx%d @%lu:%d )\n", __FUNCTION__, width, 
height, phys, pitch );
-
-     D_ASSERT( width  > 7 );
-     D_ASSERT( height > 0 );
-
-     D_ASSERT( (phys & 7) == 0 );
-
-     D_ASSERT( pitch > 0 );
-     D_ASSERT( pitch < 0x10000 );
-     D_ASSERT( (pitch & 3) == 0 );
-
-     /* Choose input format. */
-     switch (format) {
-          case DSPF_RGB32:
-          case DSPF_ARGB:
-               MLDDFR = 0;
-               break;
-
-          case DSPF_RGB16:
-               MLDDFR = 3;
-               break;
-
-          case DSPF_RGB444:
-          case DSPF_ARGB4444:
-               MLDDFR = 8;
-               break;
-
-          case DSPF_RGB24:
-               MLDDFR = 11;
-               break;
-
-          case DSPF_NV12:
-               MLDDFR = 0x10000;
-               break;
-
-          case DSPF_NV16:
-               MLDDFR = 0x10100;
-               break;
-
-          default:
-               D_BUG( "invalid format" );
-               return;
-     }
-
-     /* Setup swapping. */
-     switch (format) {
-          case DSPF_NV12:     /* 1 byte */
-          case DSPF_NV16:
-          case DSPF_RGB24:
-               LDDDSR = 7;
-               break;
-
-          case DSPF_RGB16:    /* 2 byte */
-          case DSPF_RGB444:
-          case DSPF_ARGB4444:
-               LDDDSR = 6;
-               break;
-
-          case DSPF_RGB32:    /* 4 byte */
-          case DSPF_ARGB:
-               LDDDSR = 4;
-               break;
-
-          default:
-               D_BUG( "invalid format" );
-               return;
-     }
-
-     /* software reset of the LCD device */
-     reg = SH7722_GETREG32( drv, LCDC_LDCNT2R );
-     SH7722_SETREG32( drv, LCDC_LDCNT2R, reg | 0x100 );
-     while( SH7722_GETREG32( drv, LCDC_LDCNT2R ) & 0x100 );
-
-     /* stop the LCD while configuring */
-     SH7722_SETREG32( drv, LCDC_LDCNT2R,   0 );
-     SH7722_SETREG32( drv, LCDC_LDDCKSTPR, 1 );
-
-     SH7722_SETREG32( drv, LCDC_MLDDCKPAT1R,  0x05555555 );
-     SH7722_SETREG32( drv, LCDC_MLDDCKPAT2R,  0x55555555 );
-     SH7722_SETREG32( drv, LCDC_LDDCKR,       0x0000003c );
-     SH7722_SETREG32( drv, LCDC_MLDMT2R,      0x00000000 );
-     SH7722_SETREG32( drv, LCDC_MLDMT3R,      0x00000000 );
-     SH7722_SETREG32( drv, LCDC_MLDDFR,       MLDDFR );
-     SH7722_SETREG32( drv, LCDC_MLDSM1R,      0x00000000 );
-     SH7722_SETREG32( drv, LCDC_MLDSM2R,      0x00000000 );
-     SH7722_SETREG32( drv, LCDC_MLDSA1R,      phys );
-     SH7722_SETREG32( drv, LCDC_MLDSA2R,      DFB_PLANAR_PIXELFORMAT( format ) 
? (phys + pitch * height) : 0 );
-     SH7722_SETREG32( drv, LCDC_MLDMLSR,      pitch );
-     SH7722_SETREG32( drv, LCDC_MLDWBCNTR,    0x00000000 );
-     SH7722_SETREG32( drv, LCDC_MLDWBAR,      0x00000000 );
-#if 0
-     SH7722_SETREG32( drv, LCDC_MLDMT1R,      0x18000006 );
-     SH7722_SETREG32( drv, LCDC_MLDHCNR,      ((width / 8) << 16) | (1056 / 8) 
);
-     SH7722_SETREG32( drv, LCDC_MLDHSYNR,     ((128 / 8) << 16) | (840 / 8) );
-     SH7722_SETREG32( drv, LCDC_MLDVLNR,      (height << 16) | 525 );
-     SH7722_SETREG32( drv, LCDC_MLDVSYNR,     (2 << 16) | 490 );
-     SH7722_SETREG32( drv, LCDC_MLDPMR,       0xf6000f00 );
-#elif 0
-     SH7722_SETREG32( drv, LCDC_MLDMT1R,      0x1c00000a );
-     SH7722_SETREG32( drv, LCDC_MLDHCNR,      0x00500060);
-     SH7722_SETREG32( drv, LCDC_MLDHSYNR,     0x00010052);
-     SH7722_SETREG32( drv, LCDC_MLDVLNR,      0x01e00200);
-     SH7722_SETREG32( drv, LCDC_MLDVSYNR,     0x000301f0);
-     SH7722_SETREG32( drv, LCDC_MLDPMR,       0x00000000 );    //igel
-#elif defined(SH7722_ALGO_PANEL)
-     SH7722_SETREG32( drv, LCDC_MLDMT1R,      0x1c00000a );
-     SH7722_SETREG32( drv, LCDC_MLDHCNR,      0x00500060);
-     SH7722_SETREG32( drv, LCDC_MLDHSYNR,     0x00010052);
-     SH7722_SETREG32( drv, LCDC_MLDVLNR,      0x01e0020e);
-     SH7722_SETREG32( drv, LCDC_MLDVSYNR,     0x000301f0);
-     SH7722_SETREG32( drv, LCDC_MLDPMR,       0x00000000 );    //igel
-#elif defined(ALGO_AP325)
-     SH7722_SETREG32( drv, LCDC_MLDMT1R,      0x1800000a );
-     SH7722_SETREG32( drv, LCDC_MLDHCNR,      ((width / 8) << 16) | (1000 / 8) 
);
-     SH7722_SETREG32( drv, LCDC_MLDHSYNR,     ((8 / 8) << 16) | (960 / 8) );
-     SH7722_SETREG32( drv, LCDC_MLDVLNR,      (height << 16) | 624 );
-     SH7722_SETREG32( drv, LCDC_MLDVSYNR,     (1 << 16) | 560 );
-     SH7722_SETREG32( drv, LCDC_MLDPMR,       0x00000000 );
-#endif
-     SH7722_SETREG32( drv, LCDC_LDINTR,       0x00000000 );
-     SH7722_SETREG32( drv, LCDC_LDRCNTR,      0x00000000 );
-     SH7722_SETREG32( drv, LCDC_LDDDSR,       swap ? LDDDSR : 0 );
-     SH7722_SETREG32( drv, LCDC_LDRCR,        0x00000000 );
-     SH7722_SETREG32( drv, LCDC_LDPALCR,      0x00000000 );
-     
-     /* enable and start displaying */
-     SH7722_SETREG32( drv, LCDC_LDCNT1R,      0x00000001 );
-     SH7722_SETREG32( drv, LCDC_LDCNT2R,      0x00000003 );
-     SH7722_SETREG32( drv, LCDC_LDDCKSTPR, 0 );
-     while( SH7722_GETREG32( drv, LCDC_LDDCKSTPR ) & 0x10000 );
-     
-     /* finally, turn the display on */
-     {
-          SH7722DriverData *sdrv = drv;
-          if (ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_POWER_DISPLAY ) < 0)
-               D_PERROR( "SH772xGFX_IOCTL_POWER_DISPLAY\n" );
-     }
-}
-
diff --git a/gfxdrivers/sh772x/sh7722_lcd.h b/gfxdrivers/sh772x/sh7722_lcd.h
deleted file mode 100644
index 4e0a12d..0000000
--- a/gfxdrivers/sh772x/sh7722_lcd.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __SH7722__LCD_H__
-#define __SH7722__LCD_H__
-
-#include "sh7722_types.h"
-
-
-void sh7722_lcd_setup( void                  *drv,
-                       int                    width,
-                       int                    height,
-                       ulong                  phys,
-                       int                    pitch,
-                       DFBSurfacePixelFormat  format,
-                       bool                   swap );
-
-
-#endif
-
diff --git a/gfxdrivers/sh772x/sh7722_regs.h b/gfxdrivers/sh772x/sh7722_regs.h
index d6590be..e67885f 100644
--- a/gfxdrivers/sh772x/sh7722_regs.h
+++ b/gfxdrivers/sh772x/sh7722_regs.h
@@ -8,7 +8,6 @@
 
 #define VEU_REG_BASE     0xFE920000
 #define SH7722_BEU_BASE  0xFE930000
-#define LCDC_REG_BASE    0xFE940000
 
 
 /******************************************************************************
@@ -377,44 +376,4 @@
 #define VEU_VBSRR             (VEU_REG_BASE + 0x00b4)
 
 
-/******************************************************************************
- * LCD
- */
-
-#define LCDC_LUT(n)           (LCDC_REG_BASE + (n) * 4)
-#define LCDC_MLDDCKPAT1R      (LCDC_REG_BASE + 0x0400)
-#define LCDC_MLDDCKPAT2R      (LCDC_REG_BASE + 0x0404)
-#define LCDC_SLDDCKPAT1R      (LCDC_REG_BASE + 0x0408)
-#define LCDC_SLDDCKPAT2R      (LCDC_REG_BASE + 0x040c)
-#define LCDC_LDDCKR           (LCDC_REG_BASE + 0x0410)
-#define LCDC_LDDCKSTPR        (LCDC_REG_BASE + 0x0414)
-#define LCDC_MLDMT1R          (LCDC_REG_BASE + 0x0418)
-#define LCDC_MLDMT2R          (LCDC_REG_BASE + 0x041c)
-#define LCDC_MLDMT3R          (LCDC_REG_BASE + 0x0420)
-#define LCDC_MLDDFR           (LCDC_REG_BASE + 0x0424)
-#define LCDC_MLDSM1R          (LCDC_REG_BASE + 0x0428)
-#define LCDC_MLDSM2R          (LCDC_REG_BASE + 0x042c)
-#define LCDC_MLDSA1R          (LCDC_REG_BASE + 0x0430)
-#define LCDC_MLDSA2R          (LCDC_REG_BASE + 0x0434)
-#define LCDC_MLDMLSR          (LCDC_REG_BASE + 0x0438)
-#define LCDC_MLDWBFR          (LCDC_REG_BASE + 0x043c)
-#define LCDC_MLDWBCNTR        (LCDC_REG_BASE + 0x0440)
-#define LCDC_MLDWBAR          (LCDC_REG_BASE + 0x0444)
-#define LCDC_MLDHCNR          (LCDC_REG_BASE + 0x0448)
-#define LCDC_MLDHSYNR         (LCDC_REG_BASE + 0x044c)
-#define LCDC_MLDVLNR          (LCDC_REG_BASE + 0x0450)
-#define LCDC_MLDVSYNR         (LCDC_REG_BASE + 0x0454)
-#define LCDC_MLDHPDR          (LCDC_REG_BASE + 0x0458)
-#define LCDC_MLDVPDR          (LCDC_REG_BASE + 0x045c)
-#define LCDC_MLDPMR           (LCDC_REG_BASE + 0x0460)
-#define LCDC_LDPALCR          (LCDC_REG_BASE + 0x0464)
-#define LCDC_LDINTR           (LCDC_REG_BASE + 0x0468)
-#define LCDC_LDSR             (LCDC_REG_BASE + 0x046c)
-#define LCDC_LDCNT1R          (LCDC_REG_BASE + 0x0470)
-#define LCDC_LDCNT2R          (LCDC_REG_BASE + 0x0474)
-#define LCDC_LDRCNTR          (LCDC_REG_BASE + 0x0478)
-#define LCDC_LDDDSR           (LCDC_REG_BASE + 0x047c)
-#define LCDC_LDRCR            (LCDC_REG_BASE + 0x0484)
-
-
 #endif
-- 
1.7.1

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to