fixes for [2474091] Saw Poor behaviour playing a video.

- fix a bug when hacking video buffers into gralloc buffers
 where the buffer size was incorrect this was causing the
 "direct-form-texture" mode to fail

- also when the above fails, make sure to revert to the
 "mdp copy mode" before going to "slow mode"

- finally disable completely the "direct-from-texture" mode
 for now. It cannot work because the allocated buffers can't
 respect the GPU constraints (alignment and such). We'll
 have to find a solution for that.
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index b0109ca..63b5720 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -666,22 +666,15 @@
             dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID,
             (EGLClientBuffer)clientBuf, attrs);
 
-    LOGE_IF(texture->image == EGL_NO_IMAGE_KHR,
-            "eglCreateImageKHR() failed. err=0x%4x",
-            eglGetError());
-
     if (texture->image != EGL_NO_IMAGE_KHR) {
         glBindTexture(GL_TEXTURE_2D, texture->name);
         glEGLImageTargetTexture2DOES(GL_TEXTURE_2D,
                 (GLeglImageOES)texture->image);
         GLint error = glGetError();
         if (UNLIKELY(error != GL_NO_ERROR)) {
-            // this failed, for instance, because we don't support NPOT.
-            // FIXME: do something!
             LOGE("layer=%p, glEGLImageTargetTexture2DOES(%p) "
                  "failed err=0x%04x",
                  this, texture->image, error);
-            mFlags &= ~DisplayHardware::DIRECT_TEXTURE;
             err = INVALID_OPERATION;
         } else {
             // Everything went okay!
@@ -691,6 +684,8 @@
             texture->height = clientBuf->height;
         }
     } else {
+        LOGE("layer=%p, eglCreateImageKHR() failed. err=0x%4x",
+                this, eglGetError());
         err = INVALID_OPERATION;
     }
     return err;