Merge commit 'juri/juha-devel' into real-master
authorRiku Voipio <riku.voipio@nokia.com>
Wed, 1 Apr 2009 15:44:49 +0000 (18:44 +0300)
committerRiku Voipio <riku.voipio@nokia.com>
Wed, 1 Apr 2009 15:44:49 +0000 (18:44 +0300)
audio/coreaudio.c
hw/omap3.c
hw/omap3_lcd_panel_template.h
hw/omap3_usb.c
hw/omap_dss.c

index 9671429..c865775 100644 (file)
@@ -47,6 +47,9 @@ typedef struct coreaudioVoiceOut {
     pthread_mutex_t mutex;
     int isAtexit;
     AudioDeviceID outputDeviceID;
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+    AudioDeviceIOProcID ioProcID;
+#endif
     UInt32 audioDevicePropertyBufferFrameSize;
     AudioStreamBasicDescription outputStreamBasicDescription;
     int live;
@@ -56,7 +59,7 @@ typedef struct coreaudioVoiceOut {
 
 static void coreaudio_logstatus (OSStatus status)
 {
-    char *str = "BUG";
+    const char *str = "BUG";
 
     switch(status) {
     case kAudioHardwareNoError:
@@ -104,7 +107,7 @@ static void coreaudio_logstatus (OSStatus status)
         break;
 
     default:
-        AUD_log (AUDIO_CAP, "Reason: status code %ld\n", status);
+        AUD_log (AUDIO_CAP, "Reason: status code %d\n", status);
         return;
     }
 
@@ -362,7 +365,7 @@ static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
         &core->audioDevicePropertyBufferFrameSize);
     if (status != kAudioHardwareNoError) {
         coreaudio_logerr2 (status, typ,
-                           "Could not set device buffer frame size %ld\n",
+                           "Could not set device buffer frame size %d\n",
                            core->audioDevicePropertyBufferFrameSize);
         return -1;
     }
@@ -418,7 +421,14 @@ static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
     }
 
     /* set Callback */
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+    status = AudioDeviceCreateIOProcID(core->outputDeviceID,
+                                       audioDeviceIOProc,
+                                       hw,
+                                       &core->ioProcID);
+#else
     status = AudioDeviceAddIOProc(core->outputDeviceID, audioDeviceIOProc, hw);
+#endif
     if (status != kAudioHardwareNoError) {
         coreaudio_logerr2 (status, typ, "Could not set IOProc\n");
         core->outputDeviceID = kAudioDeviceUnknown;
@@ -430,7 +440,11 @@ static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
         status = AudioDeviceStart(core->outputDeviceID, audioDeviceIOProc);
         if (status != kAudioHardwareNoError) {
             coreaudio_logerr2 (status, typ, "Could not start playback\n");
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+            AudioDeviceDestroyIOProcID(core->outputDeviceID, core->ioProcID);
+#else
             AudioDeviceRemoveIOProc(core->outputDeviceID, audioDeviceIOProc);
+#endif
             core->outputDeviceID = kAudioDeviceUnknown;
             return -1;
         }
@@ -455,8 +469,13 @@ static void coreaudio_fini_out (HWVoiceOut *hw)
         }
 
         /* remove callback */
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+        status = AudioDeviceDestroyIOProcID(core->outputDeviceID,
+                                            core->ioProcID);
+#else
         status = AudioDeviceRemoveIOProc(core->outputDeviceID,
                                          audioDeviceIOProc);
+#endif
         if (status != kAudioHardwareNoError) {
             coreaudio_logerr (status, "Could not remove IOProc\n");
         }
index f769585..5e0d89d 100644 (file)
@@ -2787,6 +2787,7 @@ static uint32_t omap3_cm_read(void *opaque, target_phys_addr_t addr)
         case 0x0b10: return s->cm_iclken_sgx;
         case 0x0b20: return s->cm_idlest_sgx & 0x0;
         case 0x0b40: return s->cm_clksel_sgx;
+        case 0x0b44: return s->cm_sleepdep_sgx;
         case 0x0b48: return s->cm_clkstctrl_sgx;
         case 0x0b4c: return s->cm_clkstst_sgx;
         /* WKUP_CM */
@@ -2988,7 +2989,7 @@ static void omap3_cm_write(void *opaque,
         case 0xb00: s->cm_fclken_sgx = value & 0x2; break;
         case 0xb10: s->cm_iclken_sgx = value & 0x1; break;
         case 0xb40: s->cm_clksel_sgx = value; break; /* TODO: SGX clock */
-        case 0xb44: s->cm_sleepdep_sgx = value &0x2; break;
+        case 0xb44: s->cm_sleepdep_sgx = value & 0x2; break;
         case 0xb48: s->cm_clkstctrl_sgx = value & 0x3; break;
         /* WKUP_CM */
         case 0xc00:
index 8695c83..dc56f03 100644 (file)
@@ -54,7 +54,8 @@
 
 
 static void glue(omap3_lcd_panel_draw_line16_, DEPTH)(PIXEL_TYPE *dest,
-                const uint16_t *src, unsigned int width)
+                                                      const uint16_t *src,
+                                                      unsigned int width)
 {
 #if !defined(SWAP_WORDS) && DEPTH == 16
     memcpy(dest, src, width);
@@ -75,38 +76,61 @@ static void glue(omap3_lcd_panel_draw_line16_, DEPTH)(PIXEL_TYPE *dest,
 #endif
 }
 
-/*
-LCD: 0x4: RGB 12      
-        0x5: ARGB16
-        0x6: RGB 16
-        0x8: RGB 24 (un-packed in 32-bit container)
-        0x9: RGB 24 (packed in 24-bit container)
-        0xc: ARGB32
-        0xd: RGBA32
-        0xe: RGBx 32 (24-bit RGB aligned on MSB of the 32-bit container)
-
-SDL:  8/16/24/32
+static void glue(omap3_lcd_panel_draw_line24a_, DEPTH)(PIXEL_TYPE *dest,
+                                                       const uint8_t *src,
+                                                       unsigned int width)
+{
+#if !defined(SWAP_WORDS) && DEPTH == 32
+    memcpy(dest, src, width);
+#else
+    unsigned int r, g, b;
+    const uint8_t *end = (const void *) src + width;
+    while (src < end) {
+        b = *(src++);
+        g = *(src++);
+        r = *(src++);
+        src++;
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
+    }
+#endif
+}
 
-*/
+static void glue(omap3_lcd_panel_draw_line24b_, DEPTH)(PIXEL_TYPE *dest,
+                                                       const uint8_t *src,
+                                                       unsigned int width)
+{
+#if DEPTH == 24
+    memcpy(dest, src, width);
+#else
+    unsigned int r, g, b;
+    const uint8_t *end = (const void *) src + width;
+    while (src < end) {
+        b = *(src++);
+        g = *(src++);
+        r = *(src++);
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
+    }
+#endif
+}
 
 /* No rotation */
 static omap3_lcd_panel_fn_t glue(omap3_lcd_panel_draw_fn_, DEPTH)[0x10] = {
-    NULL,   /*0x0*/
-    NULL,   /*0x1*/
-    NULL,   /*0x2*/
-    NULL,   /*0x3*/
-    NULL,  /*0x4:RGB 12 */
-    NULL,  /*0x5: ARGB16 */
-    (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line16_, DEPTH),  /*0x6: RGB 16 */
-    NULL,  /*0x7*/
-    NULL,  /*0x8: RGB 24 (un-packed in 32-bit container) */
-    NULL,  /*0x9: RGB 24 (packed in 24-bit container) */
-    NULL,  /*0xa */
-    NULL,  /*0xb */
-    NULL,  /*0xc: ARGB32 */
-    NULL,  /*0xd: RGBA32 */
-    NULL,  /*0xe: RGBx 32 (24-bit RGB aligned on MSB of the 32-bit container) */
-    NULL,  /*0xf */
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line16_, DEPTH),
+    NULL,
+    (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line24a_, DEPTH),
+    (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line24b_, DEPTH),
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 };
 
 /* 90deg, 180deg and 270deg rotation */
index 111c3a6..6141fac 100644 (file)
@@ -25,6 +25,9 @@
 #include "devices.h"
 #include "hw.h"
 
+#define OMAP3_HSUSB_OTG
+//#define OMAP3_HSUSB_HOST
+
 #define OMAP3_HSUSB_DEBUG
 
 #ifdef OMAP3_HSUSB_DEBUG
@@ -33,6 +36,7 @@
 #define TRACE(...)
 #endif
 
+#ifdef OMAP3_HSUSB_OTG
 /* usb-musb.c */
 extern CPUReadMemoryFunc *musb_read[];
 extern CPUWriteMemoryFunc *musb_write[];
@@ -264,7 +268,9 @@ static void omap3_hsusb_otg_init(struct omap_target_agent_s *otg_ta,
                     omap3_hsusb_otg_load_state,
                     s);
 }
+#endif
 
+#ifdef OMAP3_HSUSB_HOST
 struct omap3_hsusb_host_s {
     qemu_irq ehci_irq;
     qemu_irq tll_irq;
@@ -448,10 +454,15 @@ static void omap3_hsusb_host_init(struct omap_target_agent_s *host_ta,
                     omap3_hsusb_host_save_state,
                     omap3_hsusb_host_load_state, s);
 }
+#endif
 
 struct omap3_hsusb_s {
+#ifdef OMAP3_HSUSB_OTG
     struct omap3_hsusb_otg_s otg;
+#endif
+#ifdef OMAP3_HSUSB_HOST
     struct omap3_hsusb_host_s host;
+#endif
 };
 
 struct omap3_hsusb_s *omap3_hsusb_init(struct omap_target_agent_s *otg_ta,
@@ -464,12 +475,14 @@ struct omap3_hsusb_s *omap3_hsusb_init(struct omap_target_agent_s *otg_ta,
                                        qemu_irq tll_irq)
 {
     struct omap3_hsusb_s *s = qemu_mallocz(sizeof(struct omap3_hsusb_s));
-    /* NOTE: init host controller first and OTG controller last in order to
-     * make qemu put the attached usb devices on a hub connected to the OTG */
+#ifdef OMAP3_HSUSB_HOST
     omap3_hsusb_host_init(host_ta, tll_ta,
                           ohci_irq, ehci_irq, tll_irq,
                           &s->host);
+#endif
+#ifdef OMAP3_HSUSB_OTG
     omap3_hsusb_otg_init(otg_ta, mc_irq, dma_irq, &s->otg);
+#endif
     return s;
 }
 
index f7f4fdd..0ddd403 100644 (file)
@@ -1903,8 +1903,8 @@ static const int omap3_lcd_panel_bpp[0x10] = {
     0,  /* 0x7: reserved */
     4,  /* 0x8: RGB24 (unpacked in 32-bit container) */
     3,  /* 0x9: RGB24 (packed in 24-bit container) */
-    0,  /* 0xa: reserved */
-    0,  /* 0xb: reserved */
+    2,  /* 0xa: YUV2 422 */
+    2,  /* 0xb: UYVY 422 */
     4,  /* 0xc: ARGB32 */
     4,  /* 0xd: RGBA32 */
     4,  /* 0xe: RGBx32 (24-bit RGB aligned on MSB of the 32-bit container) */
@@ -1947,7 +1947,9 @@ static void omap3_lcd_panel_update_display(void *opaque)
             exit(1);
         }
         if (!s->line_fn) {
-            fprintf(stderr, "%s:s->line_fn is NULL. Not supported gfx_format \n", __FUNCTION__);
+            fprintf(stderr,
+                    "%s: line_fn is NULL - unsupported gfx_format (%d)\n",
+                    __FUNCTION__, dss->dispc.l[0].gfx_format);
             exit(1);
         }
         if (lcd_width != ds_get_width(s->state)